[22-Jul-2019 15:26:19 Pacific/Auckland] PHP Fatal error: Maximum execution time of 60 seconds exceeded in /home/websites/mysource_matrix/packages/cms/listing_engine/listing_engine.inc on line 3148
Not a new error, but that timeout is the reason why “Nested asset listing” doesn’t really work as a way of counting descendent assets. I’m not aware of any programmatic ways to count how many assets are under an asset that are fast enough to be practical.
When I need to check manually, I go to the Permissions screen and acquire the locks to check how many assets would be cascaded to. This is fast-ish (direct query on sq_ast_tree I assume), but I don’t know how you’d go about getting that same info as part of a generated listing (short of using a DB Connection and replicating that query yourself).
Thanks John. Ideally, I want to be able to have this listing available to non technical management in case they want to check numbers provided to them.
I’ve put in a squizmap to make asset_num_kids available, and I’d rather avoid the DB Connection if I could but really need something operational real soon now.
The latter unfortunately. Some of the sites are relatively complex, and we’ve had a past problem of people not really grasping how many assets some of our hosted sites contain.
The site asset listing works reliably enough, and without hitting the timeout. The child listing that returns an asset count works well on one site or for a small selection but the number of assets (292K+) on one of our two servers is I think the tipping point - the full combined report is running ok on the server with only ~40k assets.
That report works well to give me a combined total for each server. Per site is a bit more work - we have two servers and the larger server has 150 live sites, which makes running a report for each site a little time consuming. I’m working to reorganise the sites on that server so I can generate totals for sites owned by particular organisational units.
Resurrecting this thread (hopefully) to ask, if %globals_asset_children_link_type_1^count:[asset#]% will display the number of type 1 kids of the named asset, I’m guessing it will not care about status. Is there something that’ll count type 1 live assets? Manual says no…
Depending on what type of asset status you’re trying to exclude, users with different access will get different results from your keyword replacement. A user with admin access will get the count for all assets they have access to, including archived and under construction. A user with read access will get a count for Live, Safe Edit etc.
Thanks @MelFreeman. One of the team here reminded me that “public” users will see a count of the live assets only, as that’s all they have permission to see, so %globals_asset_children_link_type_1^count:[asset#]% would work in my use case.
However a colleague also mentioned that %globals_asset_children_link_type_1:<assetid>^as_asset:asset_status_code^contains:16% should work for everyone as status code 16 = live.