Jump to content

[BUG 4.7.16] The s3Delete task is not activated correctly when deleting an Amazon S3 container


Go to solution Solved by teraßyte,

Recommended Posts

Posted

In the file /system/File/Amazon.php inside the function deleteContainer() this code is executed when adding a new delete task to delete the files in a bucket folder (container):

			/* Turn on task */
			\IPS\Db::i()->update( 'core_tasks', array( 'enabled' => 1 ), array( '`key`=?', 's3_delete' ) );

The problem is that the task's key is not s3_delete but s3Delete (no space + capitalized). This causes the task to delete the S3 files to not activate correctly.

 

The same issue is also present inside the code of the s3Delete task to disable itself in 2 different locations.

Lines 44-50:

			if ( !( $obj instanceof \IPS\File\Amazon ) )
			{
				/* Class is not Amazon, so just stop here and truncate the table as there's nothing we can really do now. */
				\IPS\Db::i()->delete( 'core_s3_deletions' );
				\IPS\Db::i()->update( 'core_tasks', array( 'enabled' => 0 ), array( '`key`=?', 's3_delete' ) );
				return NULL;
			}

Lines 96-97:

			/* Nothing to do, so switch off the task */
			\IPS\Db::i()->update( 'core_tasks', array( 'enabled' => 0 ), array( '`key`=?', 's3_delete' ) );

 

Again s3_delete is being used instead of s3Delete.

Posted

Thank you for bringing this issue to our attention! I can confirm this should be further reviewed and I have logged an internal bug report for our development team to investigate and address as necessary, in a future maintenance release.

 

  • 1 month later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...