Forum
Images from category template getting removed
Hi,
[EDIT: may this issue be related?]
I face a strange issue with categories where the assets assigned to a given category get cleaned-up after 24h – I guess – which gives me a broken path. My category template clients.html
looks like this:
<perch:category id="catTitle" type="text" label="Title" required="true" order="1" />
<img src='<perch:category id="client_logo" type="image" label="Client logo" />' alt='<perch:category id="catTitle" type="text" label="Title" required="true" />' />
<perch:category id="catSlug" type="slug" for="catTitle" suppress="true" />
This category template is used in a perch_content('our clients')
that allows content manager to decide which category to show on the home page.
<perch:categories id="clients" label="Clients" set="clients" required="true" display-as="checkboxes" divider-before="Clients to be shown on the home page">
<perch:template path="categories/clients.html" />
</perch:categories>
Somehow – and this doesn't happen with other regions – the asset gets cleaned-up after sometime and disappear from the asset panel. I've tried to look around the forum for an answer but couldn't find any.
In my config, I have set define('PERCH_CLEAN_RESOURCES', true);
.
Here's the diagnostic report from index.php where my region is located:
Debug Message
SELECT * FROM perch2_pages WHERE pagePath='/index.php' LIMIT 1
Using template: /templates/pages/attributes/seo.html
Using template: /templates/pages/attributes/seo.html
Using template: /templates/pages/attributes/seo.html
Using template: /templates/pages/attributes/seo.html
SELECT regionKey, regionHTML FROM perch2_content_regions WHERE regionPage='/index.php' OR regionPage='*' ORDER BY regionPage DESC
SELECT regionID, regionTemplate, regionPage, regionRev AS rev FROM perch2_content_regions WHERE regionKey='Our work' AND (regionPage='/our-work.php' OR regionPage='*')
SELECT * FROM ( SELECT idx.itemID, c.regionID, idx.pageID, c.itemJSON, idx2.indexValue as sortval FROM perch2_content_index idx JOIN perch2_content_items c ON idx.itemID=c.itemID AND idx.itemRev=c.itemRev AND idx.regionID=c.regionID JOIN perch2_content_index idx2 ON idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev AND idx2.indexKey='_order' WHERE ((idx.regionID=6 AND idx.itemRev=99)) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID ORDER BY sortval ASC LIMIT 0, 12
Using template: /templates/content/our-work/work_listing.html
SELECT * FROM perch2_categories ORDER BY catTreePosition ASC
SELECT SQL_CALC_FOUND_ROWS DISTINCT tbl.* FROM ( SELECT idx.itemID, main.*, idx2.indexValue as sortval FROM perch2_blog_index idx JOIN perch2_blog_posts main ON idx.itemID=main.postID AND idx.itemKey='postID' JOIN perch2_blog_index idx2 ON idx.itemID=idx2.itemID AND idx.itemKey='postID' AND idx2.indexKey='postDateTime' WHERE 1=1 AND idx.itemID=idx2.itemID AND idx.itemKey=idx2.itemKey GROUP BY idx.itemID ) as tbl WHERE (postStatus='Published' AND postDateTime<='2015-09-22 10:59:00' ) GROUP BY itemID ORDER BY sortval DESC LIMIT 0, 6
SELECT FOUND_ROWS() AS `count`
SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0
Using template: /templates/blog/posts_in_list.html
SELECT * FROM perch2_blog_authors ORDER BY authorFamilyName, authorGivenName ASC
SELECT * FROM perch2_blog_sections ORDER BY sectionTitle ASC
SELECT setID FROM perch2_category_sets WHERE setSlug='offices' LIMIT 1
SELECT main.* FROM perch2_categories main WHERE 1=1 AND setID='4' ORDER BY catTreePosition ASC
Using template: /templates/categories/offices.html
Using sub-template: /templates/content/text_block_simple.html
SELECT setID FROM perch2_category_sets WHERE setSlug='offices' LIMIT 1
SELECT main.* FROM perch2_categories main WHERE 1=1 AND setID='4' ORDER BY catTreePosition ASC
Using template: /templates/categories/offices_simple.html
SELECT * FROM perch2_pages WHERE pageNew=0 AND pageHidden=0 ORDER BY pageTreePosition ASC
SELECT pageTreePosition FROM perch2_pages WHERE pagePath='/index.php' LIMIT 1
SELECT pageID FROM perch2_pages WHERE pageTreePosition IN ('000-001', '000')
Using template: /templates/navigation/item_footer.html
Here's the diagnostic report from the settings in Perch admin:
Perch: 2.8.13, PHP: 5.6.10, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 3c688b6bbc30d36af3ac34fdd4b7b5b787fe5555 $, with PDO
Server OS: Darwin, apache2handler
Installed apps: content (2.8.13), assets (2.8.13), categories (2.8.13), perch_blog (4.6)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_blog' );
PERCH_LOGINPATH: /perch
PERCH_PATH: /Users/me/Documents/dev/path-to-site/perch
PERCH_CORE: /Users/me/Documents/dev/path-to-site/perch/core
PERCH_RESFILEPATH: /Users/me/Documents/dev/path-to-site/perch/resources
Image manipulation: GD
PHP limits: Max upload 32M, Max POST 32M, Memory: 128M, Total max file upload: 32M
Resource folder writeable: Yes
HTTP_HOST: site.local:8888
DOCUMENT_ROOT: /Users/me/Documents/dev/path-to-site
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
Here's the debut message when I click on my region Our clients in the Perch Admin:
Debug Message
SELECT u.*, r.* FROM perch2_users u, perch2_user_roles r WHERE u.roleID=r.roleID AND u.userEnabled=1 AND u.userID=1 AND u.userHash='020ddd01578b6072cc33930826a1c5de' LIMIT 1
UPDATE perch2_users SET userHash='17651f805ff45f98a745cce6d8f96217' WHERE userID='1'
SELECT p.privKey FROM perch2_user_privileges p
SELECT * FROM (SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=1 OR userID=0 ORDER BY userID DESC) AS settings GROUP BY settingID
SELECT * FROM perch2_content_regions WHERE regionID=7 LIMIT 1
SELECT * FROM perch2_pages WHERE pageID='1' LIMIT 1
SELECT * FROM perch2_content_items WHERE regionID=7 AND itemRev=20 ORDER BY itemOrder ASC
SELECT * FROM perch2_content_items WHERE regionID=7 AND itemRev=20 ORDER BY itemOrder ASC
Using template: /templates/content/our-client/our_client.html
Using sub-template: /templates/content/titles/headline.html
Using sub-template: /templates/categories/clients.html
Form not posted or did not validate
SELECT * FROM perch2_categories c, perch2_category_sets s WHERE c.setID=s.setID AND s.setSlug='clients' ORDER BY catTreePosition ASC
Queries: 10
Memory: 3.6387
Thanks for your help.
Thanks, we'll log it to investigate.
I'll set PERCH_CLEAN_RESOURCES to false in the meantime.
Thanks.