Forums / Setup & design / trash count[SOLVED]

trash count[SOLVED]

Author Message

Mads Ovesen

Wednesday 09 November 2005 3:45:04 am

I have a problem with the trash in admin. Even though there are only 20 objects in the trashcan, the trash_count function thinks there are 400. This causes the google to make a lot of empty pages. Does anyone know whats wrong and how to fix this problem?

- Thx

/m

Ɓukasz Serwatka

Tuesday 13 December 2005 11:54:05 pm

Hi Mads,

Could you post your solution here?

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Mads Ovesen

Monday 19 December 2005 3:04:48 am

Sure, I was going to, but just forgot about it. There are two functions controlling the trash in trash.tpl:
1) Trash_count fetches the number of items in the trash (objects with status 2 in the ezcontentobject table).
2) Trash_object_list fetches the trashed objects (also status 2).

The integer returned by trash_count is different compared to the number of objects returned by trash_object_list in version 3.4.8. The reason is that the trash_object_list function is based on each user while trash_count is based on the global trash. I can't come up with a reason why this is so, so I made trash_count function count only the trash objects of each user by editing the following in kernel/content/ezcontentfunctioncollection.php to the following:

function fetchTrashObjectCount()
    {
        $userID = ezUser::currentUserID();
        $trashObjectList = &eZPersistentObject::fetchObjectList( 
                       eZContentObject::definition(), array(), 
                       array( 'status' => EZ_CONTENT_OBJECT_STATUS_ARCHIVED, 'owner_id' => $userID ), 
                       array(), null, false,false, 
                       array( array( 'operation' => 'count( * )',                                                                                                                                                        
                       'name' => 'count' ) ) );     

return array( 'result' => $trashObjectList[0]['count'] );
}

/m

eZ debug

Timing: Jan 21 2025 21:02:35
Script start
Timing: Jan 21 2025 21:02:35
Module start 'content'
Timing: Jan 21 2025 21:02:35
Module end 'content'
Timing: Jan 21 2025 21:02:35
Script end

Main resources:

Total runtime0.1836 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0080 587.6094180.8438
Module start 'content' 0.00800.0056 768.453193.9609
Module end 'content' 0.01370.1698 862.4141521.8750
Script end 0.1835  1,384.2891 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00402.1677200.0002
Check MTime0.00150.8204200.0001
Mysql Total
Database connection0.00090.465710.0009
Mysqli_queries0.126068.60591410.0009
Looping result0.00170.91221390.0000
Template Total0.169492.210.1694
Template load0.00120.634010.0012
Template processing0.168291.609210.1682
Override
Cache load0.00090.488010.0009
Sytem overhead
Fetch class attribute can translate value0.00100.569810.0010
XML
Image XML parsing0.00030.145410.0003
General
dbfile0.00904.8992200.0004
String conversion0.00000.004330.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0002 secs