Skip to content

Commit

Permalink
- Implemented enhancement #016993: transactions in content/trash must…
Browse files Browse the repository at this point in the history
… be reduced

(cherry picked from commit e9888af)

Conflicts:

	doc/changelogs/4.4/unstable/CHANGELOG-4.4.0alpha4-to-4.4.0alpha5
  • Loading branch information
Bertrand Dunogier committed Jul 15, 2010
1 parent 4c8e64e commit bb2e308
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 2 additions & 0 deletions doc/changelogs/4.2/CHANGELOG-4.2.0-to-4.2.1
Expand Up @@ -13,6 +13,8 @@ Changes from 4.2.0 to 4.2.1
(Merged from trunk (4.3.0beta1) rev. 25129 + 25130)
- Implemented enhancement #014781: translation cache isn't deleted at "Clear all caches"
(Merged from master (4.4alpha4) commit 8322321)
- Implemented enhancement #016993: transactions in content/trash must be reduced
(Merged from master (4.4alpha5) commit e9888af)

*Design:

Expand Down
9 changes: 1 addition & 8 deletions kernel/content/trash.php
Expand Up @@ -59,8 +59,6 @@
{
$deleteIDArray = $http->postVariable( 'DeleteIDArray' );

$db = eZDB::instance();
$db->begin();
foreach ( $deleteIDArray as $deleteID )
{

Expand All @@ -70,13 +68,11 @@
null,
null,
true );
eZDebug::writeNotice( $deleteID, "deleteID" );
foreach ( $objectList as $object )
foreach ( $objectList as $object )
{
$object->purge();
}
}
$db->commit();
}
else
{
Expand All @@ -89,7 +85,6 @@
$access = $user->hasAccessTo( 'content', 'cleantrash' );
if ( $access['accessWord'] == 'yes' )
{
$db = eZDB::instance();
while ( true )
{
// Fetch 100 objects at a time, to limit transaction size
Expand All @@ -102,12 +97,10 @@
if ( count( $objectList ) < 1 )
break;

$db->begin();
foreach ( $objectList as $object )
{
$object->purge();
}
$db->commit();
}
}
else
Expand Down

0 comments on commit bb2e308

Please sign in to comment.