Posts by tempertemper

    Wondered why I wasn't seeing any activity on this thread and it looks like it had been automatically marked as resolved. I've changed that and posting this comment so hopefully it'll make it visible. Any help would be greatly appreciated 🙂

    Couldn't post this in one go (I exceeded the 10k character limit) so here's the debug after changing the values and hitting Save:


    0 recover(): ">[1] 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='74bfd0f4702436550b00fce46982b5f0' LIMIT 1
    0.0008 update(): ">UPDATE perch2_users SET userHash='13c0a8642043763e50f94e7e09d70953' WHERE userID='1'
    0.002 get(): ">[36] SELECT settingID, settingValue, userID FROM perch2_settings WHERE userID=1 OR userID=0 ORDER BY userID ASC
    0.0031 add_new_apps(): ">[8] SELECT itemValue FROM perch2_menu_items WHERE itemType='app'
    0.0107 find(): ">[1] SELECT * FROM perch2_content_regions WHERE regionID=45 LIMIT 1
    0.0036 create_new_revision(): ">INSERT INTO perch2_content_items (itemID, regionID, pageID, itemRev, itemOrder, itemJSON, itemSearch, itemUpdatedBy) SELECT itemID, regionID, pageID, 12 AS itemRev, itemOrder, itemJSON, itemSearch, '1' AS itemUpdatedBy FROM perch2_content_items WHERE regionID=45 AND itemRev=11 ORDER BY itemOrder ASC
    0.0138 create_new_revision(): ">REPLACE INTO perch2_resource_log (appID, itemFK, itemRowID, resourceID) SELECT cr.appID, cr.itemFK, c2.itemRowID, cr.resourceID FROM perch2_resource_log cr, perch2_content_items c1, perch2_content_items c2 WHERE cr.appID='content' AND cr.itemFK='itemRowID' AND cr.itemRowID=c1.itemRowID AND c1.itemID = c2.itemID AND c1.regionID=45 AND c2.regionID=45 AND c1.itemRev = 11 AND c2.itemRev = 12
    0.0032 renumber_items(): ">[1] SELECT itemRowID FROM perch2_content_items WHERE regionID=45 AND itemRev=12 ORDER BY itemOrder ASC
    0.0004 update(): ">UPDATE perch2_content_items SET itemOrder=1000 WHERE itemRowID='519345'
    0.0003 update(): ">UPDATE perch2_content_regions SET regionLatestRev=12 WHERE regionID='45'
    0.0007 get_value(): ">[1] SELECT regionRev FROM perch2_content_regions WHERE regionID=45
    0.0002 delete_old_revisions(): ">DELETE FROM perch2_content_items WHERE regionID=45 AND itemRev!=11 AND itemRev IN (SELECT itemRev FROM (SELECT DISTINCT itemRev FROM perch2_content_items WHERE regionID=45 ORDER BY itemRev DESC LIMIT 8, 99999) AS t2)
    0.004 delete_old_revisions(): ">DELETE FROM perch2_resource_log WHERE appID='content' AND itemFK='itemRowID' AND itemRowID NOT IN (SELECT itemRowID FROM perch2_content_items)
    0.0011 truncate_for_region(): ">DELETE FROM perch2_content_items WHERE itemRowID IN (SELECT itemRowID FROM (SELECT itemRowID FROM perch2_content_items WHERE regionID=45 AND itemRev=12 ORDER BY itemOrder ASC LIMIT 1, 99999999 ) AS t2 )
    0.0584 update(): ">UPDATE perch2_content_regions SET regionSearchable='1', regionTemplate='tax_data_table.html', regionKey='Income Tax Allowances', regionMultiple=0, regionEditRoles='*', regionPublishRoles='*' WHERE regionID='45'
    0.0004 update(): ">Invalid query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'regionPublishRoles' in 'field list'
    0.0002 update(): ">UPDATE perch2_content_regions SET regionOptions='{\"edit_mode\":\"listdetail\",\"searchURL\":\"\",\"title_delimit\":\"\",\"adminOnly\":0,\"addToTop\":0,\"limit\":false,\"column_ids\":[]}' WHERE regionID='45'
    0.0004 get_flat_for_region(): ">[1] SELECT * FROM perch2_content_items c WHERE c.regionID=45 AND c.itemRev=12 ORDER BY c.itemOrder ASC
    0.0077 render(): ">[6] Using template: /templates/content/tax_data_table.html
    0.0091 update(): ">UPDATE perch2_content_regions SET regionHTML='<table cellspacing=\"0\">\n\n <thead>\n\n <tr>\n <th>Income Tax Allowances</th>\n <th>2020/21</th>\n <th>2019/20</th>\n </tr>\n\n </thead>\n\n <tbody>\n\n \n <tr>\n <td>Personal Allowance</td>\n <td>£12,500</td>\n <td>£12,500</td>\n </tr>\n \n <tr>\n <td>Transferable Marriage Allowance</td>\n <td>£1,250</td>\n <td>£1,250</td>\n </tr>\n \n <tr>\n <td>Blind Persons Allowance</td>\n <td>£2,500</td>\n <td>£2,450</td>\n </tr>\n \n <tr>\n <td>Dividend Allowance</td>\n <td>£2,000</td>\n <td>£2,000</td>\n </tr>\n \n <tr>\n <td>Personal Savings Allowance (Basic rate taxpayer)</td>\n <td>£1,000</td>\n <td>£1,000</td>\n </tr>\n \n <tr>\n <td>Personal Savings Allowance (Higher rate taxpayer)</td>\n <td>£500</td>\n <td>£500</td>\n </tr>\n \n\n </tbody>\n\n</table>\n', regionRev=12, regionLatestRev=12 WHERE regionID='45'
    0.0003 get_value(): ">[1] SELECT MIN(itemRev) FROM perch2_content_items WHERE regionID=45
    0.0013 index(): ">DELETE FROM perch2_content_index WHERE regionID=45 AND itemRev<5
    0.0206 get_for_region(): ">[1] SELECT * FROM perch2_content_items WHERE regionID=45 AND itemRev=12 ORDER BY itemOrder ASC
    0.0004 index(): ">DELETE FROM perch2_content_index WHERE regionID=45 AND itemRev=12
    0.0007 index(): ">Using template: /templates/content/tax_data_table.html
    0.0016 index(): ">INSERT INTO perch2_content_index (itemID, regionID, pageID, itemRev, indexKey, indexValue) VALUES (1160,45,9,12,'tax_type','Income Tax Allowances'),(1160,45,9,12,'current_tax_year','2020/21'),(1160,45,9,12,'previous_tax_year','2019/20'),(1160,45,9,12,'images.tax_category','Personal Allowance'),(1160,45,9,12,'images.tax_category','Transferable Marriage Allowance'),(1160,45,9,12,'images.tax_category','Blind Persons Allowance'),(1160,45,9,12,'images.tax_category','Dividend Allowance'),(1160,45,9,12,'images.tax_category','Personal Savings Allowance (Basic rate taxpayer)'),(1160,45,9,12,'images.tax_category','Personal Savings Allowance (Higher rate taxpayer)'),(1160,45,9,12,'images.current_year','£12,500'),(1160,45,9,12,'images.current_year','£1,250'),(1160,45,9,12,'images.current_year','£2,500'),(1160,45,9,12,'images.current_year','£2,000'),(1160,45,9,12,'images.current_year','£1,000'),(1160,45,9,12,'images.current_year','£500'),(1160,45,9,12,'images.previous_year','£12,500'),(1160,45,9,12,'images.previous_year','£1,250'),(1160,45,9,12,'images.previous_year','£2,450'),(1160,45,9,12,'images.previous_year','£2,000'),(1160,45,9,12,'images.previous_year','£1,000'),(1160,45,9,12,'images.previous_year','£500'),(1160,45,9,12,'_id',1160),(1160,45,9,12,'_order','1000')
    0.0028 index(): ">[1] OPTIMIZE TABLE perch2_content_index
    0.2398 set(): ">Setting alert: Successfully updated (success)
    0.0003 all(): ">[2] SELECT * FROM perch2_user_roles ORDER BY roleTitle ASC
    0.0037 get_menu(): ">[1] SELECT mi.*, p.privKey FROM perch2_menu_items mi LEFT JOIN perch2_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=0 ORDER BY itemOrder ASC LIMIT 0, 1
    0.0015 get_items(): ">[3] SELECT mi.*, p.privKey FROM perch2_menu_items mi LEFT JOIN perch2_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=1 ORDER BY mi.itemOrder ASC
    0.001 get_value(): ">[1] SELECT itemTitle FROM perch2_menu_items WHERE itemType='app' AND itemValue='content' LIMIT 1
    0.0006 get_menu(): ">[1] SELECT mi.*, p.privKey FROM perch2_menu_items mi LEFT JOIN perch2_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=0 ORDER BY itemOrder ASC LIMIT 1, 10
    0.0003 get_items(): ">[2] SELECT mi.*, p.privKey FROM perch2_menu_items mi LEFT JOIN perch2_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=2 ORDER BY mi.itemOrder ASC
    0.0023 title_panel(): ">File: /core/apps/content/modes/region.options.post.php
    0.0029 Queries: 40
    0 Memory: 3.5783



    And this is my diagnostic report:


    • Perch Runway: 3.1.5, PHP: 7.2.22, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: 3591daad22de08524295e1bd073aceeff11e6579 $, with PDO
    • Server OS: Darwin, apache2handler
    • Installed apps: content (3.1.5), assets (3.1.5), categories (3.1.5), perch_forms (1.12), perch_backup
    • App runtimes: <?php $apps_list = [ 'perch_forms', ];
    • PERCH_LOGINPATH: /cms
    • PERCH_PATH: /Users/martin/Sites/grahamaccountants.com/cms
    • PERCH_CORE: /Users/martin/Sites/grahamaccountants.com/cms/core
    • PERCH_RESFILEPATH: /Users/martin/Sites/grahamaccountants.com/cms/resources
    • Image manipulation: GD
    • PHP limits: Max upload 32M, Max POST 8M, Memory: 128M, Total max file upload: 8M
    • F1: 3b606135b33e6a102526838f4152a807
    • Resource folder writeable: Yes
    • HTTP_HOST: grahamaccountants.local
    • DOCUMENT_ROOT: /Users/martin/Sites/grahamaccountants.com
    • REQUEST_URI: /cms/core/settings/diagnostics/
    • SCRIPT_NAME: /cms/core/settings/diagnostics/index.php

    I've got a newly-updated-to-Runway site and it has changed some region permissions, which I didn't expect. The website owner (I've called the role 'Editor') can edit the content in the regions but they can't publish – it saves the changes as a draft but the 'Save as draft' checkbox is greyed out.


    They needed the content out here ASAP so I did the honours as I'm the Primary Admin and I can uncheck the 'Save as draft' checkbox.


    I then went to change their permissions and something strange is happening… I go to the region, then Region Options, and in the permissions section it looks like:


    May be edited by

    [x] Everyone

    [x] Admin

    [ ] Editor


    Drafts may be published by

    [ ] Everyone

    [x] Admin

    [ ] Editor


    The problem is, when I check 'Everyone' in 'Drafts may be published by' and hit Save, it says 'Successfully updated' at the top and the checkboxes look right when I scroll down to check, but when I reload the page and scroll down the checkboxes go back to the way they were.


    I've run the page with define('PERCH_DEBUG', true); in my config and I'm seeing a red line:


    Quote

    Invalid query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'regionPublishRoles' in 'field list'


    The full debug looks like this:


    0 recover(): ">[1] 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='eb76dda1f33b22833c5d923c2cbfccef' LIMIT 1
    0.0006 update(): ">UPDATE perch2_users SET userHash='74bfd0f4702436550b00fce46982b5f0' WHERE userID='1'
    0.0036 get(): ">[36] SELECT settingID, settingValue, userID FROM perch2_settings WHERE userID=1 OR userID=0 ORDER BY userID ASC
    0.0032 add_new_apps(): ">[8] SELECT itemValue FROM perch2_menu_items WHERE itemType='app'
    0.0107 find(): ">[1] SELECT * FROM perch2_content_regions WHERE regionID=45 LIMIT 1
    0.0102 all(): ">[2] SELECT * FROM perch2_user_roles ORDER BY roleTitle ASC
    0.0057 get_menu(): ">[1] SELECT mi.*, p.privKey FROM perch2_menu_items mi LEFT JOIN perch2_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=0 ORDER BY itemOrder ASC LIMIT 0, 1
    0.001 get_items(): ">[3] SELECT mi.*, p.privKey FROM perch2_menu_items mi LEFT JOIN perch2_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=1 ORDER BY mi.itemOrder ASC
    0.0012 get_value(): ">[1] SELECT itemTitle FROM perch2_menu_items WHERE itemType='app' AND itemValue='content' LIMIT 1
    0.0004 get_menu(): ">[1] SELECT mi.*, p.privKey FROM perch2_menu_items mi LEFT JOIN perch2_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=0 ORDER BY itemOrder ASC LIMIT 1, 10
    0.0002 get_items(): ">[2] SELECT mi.*, p.privKey FROM perch2_menu_items mi LEFT JOIN perch2_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=2 ORDER BY mi.itemOrder ASC
    0.0017 title_panel(): ">File: /core/apps/content/modes/region.options.post.php
    0.0018 __call(): ">Looking up missing property regionPublishRoles
    0 get_value(): ">SELECT regionPublishRoles FROM perch2_content_regions WHERE regionID='45'
    0.0022 get_value(): ">[0] Invalid query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'regionPublishRoles' in 'field list'
    0.0028 Queries: 12
    0.0001 Memory: 2.5148



    How do I fix that 'Invalid query' issue…? =O

    This isn't the only site I'm having this problem with. It's also happening on a Runway site with perch_collection, following the Multiple filters syntax. Here's the code that works in a slightly different format, to show that I've tried a few different ways. Again, this works, but when a second filter is added it outputs nothing:


    Code
    1. perch_collection('Posts', [ 'filter' => [ // [ // This works individually, but not when the subsequent filter is active // 'filter' => 'post_date', // 'match' => 'lte', // 'value' => date('Y-m-d H:i:s') // ], [ 'filter' => 'post_date', 'match' => 'eq', 'value' => perch_get('filter_year') ] ], 'template' => 'post.html', 'sort' => 'post_date', 'sort-order' => 'DESC'
    2. ]);

    I need to filter by year and also not output any posts from the future (so my client can front-load posts).

    Here's the debug:


    0 get_route(): ">[6] SELECT p.pagePath, pr.routePattern, pr.routeRegExp, p.pageTemplate, pr.routeOrder, s.settingValue AS siteOffline FROM perch2_pages p LEFT JOIN perch2_page_routes pr ON p.pageID=pr.pageID LEFT JOIN perch2_settings s ON s.settingID='siteOffline' UNION SELECT NULL AS pagePath, pr2.routePattern, pr2.routeRegExp, pr2.templatePath AS pageTemplate, pr2.routeOrder, NULL AS siteOffline FROM perch2_page_routes pr2 WHERE templateID!=0 ORDER BY routeOrder ASC, pagePath ASC
    0.0019 get_route(): ">Matched route: [year:filter_year]
    0.0001 Using master page: /templates/pages/news.php
    0 Page arguments:
    Code
    1. Array
    2. ( [0] => /2020 [filter_year] => 2020 [1] => 2020
    3. )
    0.0067 find_by_path(): ">[1] SELECT * FROM perch2_pages WHERE pagePath='/news' LIMIT 1
    0.0024 template_attribute(): ">Using template: /templates/pages/attributes/default.html
    0.0182 get_navigation(): ">[5] SELECT * FROM perch2_pages WHERE pageNew=0 AND pageHidden=0 AND pageDepth >=0 AND pageDepth<=1 ORDER BY pageTreePosition ASC
    0.0004 get_value(): ">[1] SELECT pageTreePosition FROM perch2_pages WHERE pagePath='/news' LIMIT 1
    0.0002 find_parent_page_ids_by_path(): ">[1] SELECT pageID FROM perch2_pages WHERE pageTreePosition IN ('000-003', '000') ORDER BY pageTreePosition DESC
    0.0002 _template_nav(): ">[5] Using template: /templates/navigation/item.html
    0.0014 get_collection(): ">[1] SELECT collectionID, collectionTemplate FROM perch2_collections WHERE collectionKey='Posts'
    0.0005 get_collection(): ">[nil] SELECT * FROM ( SELECT idx.itemID, ci.collectionID, ci.itemJSON, idx2.indexValue as sortval FROM perch2_collection_index idx JOIN perch2_collection_items ci ON idx.itemID=ci.itemID AND idx.itemRev=ci.itemRev AND idx.collectionID=ci.collectionID JOIN perch2_collection_revisions cr ON idx.itemID=cr.itemID AND idx.itemRev=cr.itemRev AND idx.collectionID=ci.collectionID JOIN perch2_collection_index idx2 ON idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev AND idx2.indexKey='post_date' WHERE (idx.collectionID=3) AND ((idx.indexKey='post_date' AND idx.indexValue <= '2020-03-08 09:35:47') OR (idx.indexKey='post_date' AND idx.indexValue=2020)) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, itemJSON, sortval HAVING count(*)=2 ORDER BY sortval DESC
    0.0015 get_collection(): ">Using template: /templates/content/post.html
    0.0004 get_custom(): ">[1] SELECT regionID, regionTemplate, regionPage, regionRev AS rev FROM perch2_content_regions WHERE regionKey='Contact details' AND (regionPage='/contact' OR regionPage='*')
    0.0004 get_custom(): ">[1] 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=36 AND idx.itemRev=11)) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, pageID, itemJSON, sortval, regionID ORDER BY sortval ASC
    0.0015 get_custom(): ">[1] Using template: /templates/content/contact_footer.html
    0.0002 find_all_tag_ids(): ">Using sub-template: /templates/content/_address.html
    0.0001 find_all_tag_ids(): ">Using sub-template: /templates/layouts/svg/twitter.svg
    0.0007 _get_content(): ">[3] SELECT regionKey, regionHTML FROM perch2_content_regions WHERE regionPage='/news' OR regionPage='*' ORDER BY regionPage DESC
    0 get_route(): ">[6] SELECT p.pagePath, pr.routePattern, pr.routeRegExp, p.pageTemplate, pr.routeOrder, s.settingValue AS siteOffline FROM perch2_pages p LEFT JOIN perch2_page_routes pr ON p.pageID=pr.pageID LEFT JOIN perch2_settings s ON s.settingID='siteOffline' UNION SELECT NULL AS pagePath, pr2.routePattern, pr2.routeRegExp, pr2.templatePath AS pageTemplate, pr2.routeOrder, NULL AS siteOffline FROM perch2_page_routes pr2 WHERE templateID!=0 ORDER BY routeOrder ASC, pagePath ASC
    0.0019 get_route(): ">Matched route: [year:filter_year]
    0.0001 Using master page: /templates/pages/news.php
    0 Page arguments:
    Code
    1. Array
    2. ( [0] => /2020 [filter_year] => 2020 [1] => 2020
    3. )
    0.0067 find_by_path(): ">[1] SELECT * FROM perch2_pages WHERE pagePath='/news' LIMIT 1
    0.0024 template_attribute(): ">Using template: /templates/pages/attributes/default.html
    0.0182 get_navigation(): ">[5] SELECT * FROM perch2_pages WHERE pageNew=0 AND pageHidden=0 AND pageDepth >=0 AND pageDepth<=1 ORDER BY pageTreePosition ASC
    0.0004 get_value(): ">[1] SELECT pageTreePosition FROM perch2_pages WHERE pagePath='/news' LIMIT 1
    0.0002 find_parent_page_ids_by_path(): ">[1] SELECT pageID FROM perch2_pages WHERE pageTreePosition IN ('000-003', '000') ORDER BY pageTreePosition DESC
    0.0002 _template_nav(): ">[5] Using template: /templates/navigation/item.html
    0.0014 get_collection(): ">[1] SELECT collectionID, collectionTemplate FROM perch2_collections WHERE collectionKey='Posts'
    0.0005 get_collection(): ">[nil] SELECT * FROM ( SELECT idx.itemID, ci.collectionID, ci.itemJSON, idx2.indexValue as sortval FROM perch2_collection_index idx JOIN perch2_collection_items ci ON idx.itemID=ci.itemID AND idx.itemRev=ci.itemRev AND idx.collectionID=ci.collectionID JOIN perch2_collection_revisions cr ON idx.itemID=cr.itemID AND idx.itemRev=cr.itemRev AND idx.collectionID=ci.collectionID JOIN perch2_collection_index idx2 ON idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev AND idx2.indexKey='post_date' WHERE (idx.collectionID=3) AND ((idx.indexKey='post_date' AND idx.indexValue <= '2020-03-08 09:35:47') OR (idx.indexKey='post_date' AND idx.indexValue=2020)) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, itemJSON, sortval HAVING count(*)=2 ORDER BY sortval DESC
    0.0015 get_collection(): ">Using template: /templates/content/post.html
    0.0004 get_custom(): ">[1] SELECT regionID, regionTemplate, regionPage, regionRev AS rev FROM perch2_content_regions WHERE regionKey='Contact details' AND (regionPage='/contact' OR regionPage='*')
    0.0004 get_custom(): ">[1] 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=36 AND idx.itemRev=11)) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, pageID, itemJSON, sortval, regionID ORDER BY sortval ASC
    0.0015 get_custom(): ">[1] Using template: /templates/content/contact_footer.html
    0.0002 find_all_tag_ids(): ">Using sub-template: /templates/content/_address.html
    0.0001 find_all_tag_ids(): ">Using sub-template: /templates/layouts/svg/twitter.svg
    0.0007 _get_content(): ">[3] SELECT regionKey, regionHTML FROM perch2_content_regions WHERE regionPage='/news' OR regionPage='*' ORDER BY regionPage DESC
    0.0042 Request time: 0.0939
    0 Process time: 0.0827
    0 Memory: 3.5229



    And here's the diagnostics:


    • Perch Runway: 3.1.5, PHP: 7.2.22, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: 3591daad22de08524295e1bd073aceeff11e6579 $, with PDO
    • Server OS: Darwin, apache2handler
    • Installed apps: content (3.1.5), assets (3.1.5), categories (3.1.5), perch_forms (1.12), perch_backup
    • App runtimes: <?php $apps_list = [ 'perch_forms', ];
    • PERCH_LOGINPATH: /cms
    • PERCH_PATH: /Users/martin/Sites/grahamaccountants.com/cms
    • PERCH_CORE: /Users/martin/Sites/grahamaccountants.com/cms/core
    • PERCH_RESFILEPATH: /Users/martin/Sites/grahamaccountants.com/cms/resources
    • Image manipulation: GD
    • PHP limits: Max upload 32M, Max POST 8M, Memory: 128M, Total max file upload: 8M
    • F1: 3b606135b33e6a102526838f4152a807
    • Resource folder writeable: Yes
    • HTTP_HOST: grahamaccountants.local
    • DOCUMENT_ROOT: /Users/martin/Sites/grahamaccountants.com
    • REQUEST_URI: /cms/core/settings/diagnostics/
    • SCRIPT_NAME: /cms/core/settings/diagnostics/index.php

    I'm having a problem where I need to use more than one filter but when I do it's not returning any content. Individually, the filters work fine, but when I combine them using the multiple filter syntax for perch_content_custom (I'm using perch_blog_custom, but this should translate) they don't work. Here's the code that isn't working with the code that does work in comments:



    I can't see any syntax issues (although there's a typo in the first example in the docs: a closing rounded parenthesis instead of a closing square bracket).


    This thread from late last year mentions the same issue but goes quiet.


    Here's what Perch Debug outputs:


    0 get(): ">[59] SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0
    0.0131 find_by_path(): ">[1] SELECT * FROM perch2_pages WHERE pagePath='/spotlight/post.php' LIMIT 1
    0.0033 get_navigation(): ">[6] SELECT * FROM perch2_pages WHERE pageNew=0 AND pageHidden=0 AND pageDepth >=0 AND pageDepth<=1 ORDER BY pageTreePosition ASC
    0.0005 get_value(): ">[1] SELECT pageTreePosition FROM perch2_pages WHERE pagePath='/spotlight/post.php' LIMIT 1
    0.0004 find_parent_page_ids_by_path(): ">[2] SELECT pageID FROM perch2_pages WHERE pageTreePosition IN ('000-005-001', '000-005', '000') ORDER BY pageTreePosition DESC
    0.0004 _template_nav(): ">[6] Using template: /templates/navigation/item.html
    0.0167 find_by_slug(): ">[1] SELECT * FROM perch2_blog_posts WHERE postStatus='Published' AND postDateTime<='2020-03-08 09:26:00' AND postSlug='driving-fintech-adoption'
    0.0106 all(): ">[1] SELECT * FROM perch2_blog_sections ORDER BY sectionTitle ASC
    0.0009 all(): ">[1] SELECT * FROM perch2_blogs ORDER BY blogTitle ASC
    0.002 set(): ">Using template: /templates/blog/post.html
    0.0024 get_filtered_listing_from_index(): ">[1] 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='_id' WHERE 1=1 AND ((idx.indexKey='postSlug' AND idx.indexValue='driving-fintech-adoption')) AND idx.itemID=idx2.itemID AND idx.itemKey=idx2.itemKey GROUP BY idx.itemID, idx2.indexValue, postID ) as tbl WHERE (postStatus='Published' AND postDateTime<='2020-03-08 09:26:00' ) GROUP BY itemID, sortval ORDER BY sortval ASC LIMIT 0, 10
    0.0039 get_value(): ">[1] SELECT FOUND_ROWS() AS `count`
    0.0004 set(): ">[1] Using template: /templates/blog/post.html
    0.0008 all(): ">[16] SELECT * FROM perch2_blog_authors ORDER BY authorFamilyName, authorGivenName ASC
    0.0036 get_filtered_listing_from_index(): ">[nil] SELECT 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.indexKey='spotlight' AND idx.indexValue='spotlight') OR (idx.indexKey='postSlug' AND idx.indexValue != 'driving-fintech-adoption')) AND idx.itemID=idx2.itemID AND idx.itemKey=idx2.itemKey GROUP BY idx.itemID, idx2.indexValue, postID ) as tbl WHERE (postStatus='Published' AND postDateTime<='2020-03-08 09:26:00' ) GROUP BY itemID, sortval HAVING count(*)=2 ORDER BY sortval DESC LIMIT 0, 3
    0.0606 set(): ">Using template: /templates/blog/post_in_list.html
    0.0002 use_noresults(): ">Rescoping to perch:blog
    0 use_noresults(): ">Using sub-template: /templates/pagination/blog.html
    0.0031 get_custom(): ">[1] SELECT regionID, regionTemplate, regionPage, regionRev AS rev FROM perch2_content_regions WHERE regionKey='Call to action' AND (regionPage='/spotlight/post.php' OR regionPage='*')
    0.0006 get_custom(): ">[1] 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=115 AND idx.itemRev=4)) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, pageID, itemJSON, sortval, regionID ORDER BY sortval ASC
    0.0023 get_custom(): ">[1] Using template: /templates/content/introduction.html
    0.0063 get_value(): ">[1] SELECT groupID FROM perch2_navigation WHERE groupSlug='useful-links' LIMIT 1
    0.0007 get_navigation(): ">[9] SELECT np.pageID, np.pageParentID, p.pagePath, p.pageTitle, p.pageNavText, p.pageNew, p.pageOrder, np.pageDepth, p.pageSortPath, np.pageTreePosition, p.pageAccessTags, p.pageAttributes FROM perch2_navigation_pages np, perch2_pages p WHERE p.pageID=np.pageID AND np.groupID=1 AND p.pageNew=0 AND np.pageDepth >=0 AND np.pageDepth<=1 ORDER BY np.pageTreePosition ASC
    0.0105 get_value(): ">[0] SELECT np.pageTreePosition FROM perch2_pages p, perch2_navigation_pages np WHERE np.pageID=p.pageID AND np.groupID=1 AND p.pagePath='/spotlight/post.php' LIMIT 1
    0.0023 _template_nav(): ">[9] Using template: /templates/navigation/item.html
    0.006 get_custom(): ">[1] SELECT regionID, regionTemplate, regionPage, regionRev AS rev FROM perch2_content_regions WHERE regionKey='Primary content' AND (regionPage='/contact/index.php' OR regionPage='*')
    0.0008 get_custom(): ">[1] 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=22 AND idx.itemRev=13)) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, pageID, itemJSON, sortval, regionID ORDER BY sortval ASC
    0.0026 get_custom(): ">[1] Using template: /templates/content/_address.html
    0.0027 get_custom(): ">[1] 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=22 AND idx.itemRev=13)) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, pageID, itemJSON, sortval, regionID ORDER BY sortval ASC
    0.0045 get_custom(): ">[1] Using template: /templates/content/_contact_details.html
    0.0031 _get_content(): ">[3] SELECT regionKey, regionHTML FROM perch2_content_regions WHERE regionPage='/spotlight/post.php' OR regionPage='*' ORDER BY regionPage DESC


    Any my diagnostics:

    • Perch: 3.1.5, PHP: 7.2.22, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: 3591daad22de08524295e1bd073aceeff11e6579 $, with PDO
    • Server OS: Darwin, apache2handler
    • Installed apps: content (3.1.5), categories (3.1.5), assets (3.1.5), perch_blog (5.6.1), perch_forms (1.12), perch_members (1.6.4), perch_backup (1.2)
    • App runtimes: <?php $apps_list = [ 'perch_forms', 'perch_blog', 'perch_members', ];
    • PERCH_LOGINPATH: /cms
    • PERCH_PATH: /Users/martin/Sites/gustoresearch.com/web/cms
    • PERCH_CORE: /Users/martin/Sites/gustoresearch.com/web/cms/core
    • PERCH_RESFILEPATH: /Users/martin/Sites/gustoresearch.com/web/cms/resources
    • Image manipulation: GD
    • PHP limits: Max upload 32M, Max POST 8M, Memory: 128M, Total max file upload: 8M
    • F1: 3b606135b33e6a102526838f4152a807
    • Resource folder writeable: Yes
    • HTTP_HOST: gustoresearch.local
    • DOCUMENT_ROOT: /Users/martin/Sites/gustoresearch.com/web
    • REQUEST_URI: /cms/core/settings/diagnostics/
    • SCRIPT_NAME: /cms/core/settings/diagnostics/index.php


    Please help!

    My email sending service (Postmark) has dropped support for TLSv1.0, so I need to work out where to enforce sending over TLSv1.1 or above. Is this something I need to do in Perch (something to do with PHP Mailer that's baked in)?


    I've had a poke through the code and this block in core/lib/PHPMailer.class.php suggests the TLS version isn't something to do with Perch:


    ```

    /**

    * Initiate a TLS (encrypted) session.

    * @access public

    * @return boolean

    */

    public function startTLS()

    {

    if (!$this->sendCommand('STARTTLS', 'STARTTLS', 220)) {

    return false;

    }


    //Allow the best TLS version(s) we can

    $crypto_method = STREAM_CRYPTO_METHOD_TLS_CLIENT;


    //PHP 5.6.7 dropped inclusion of TLS 1.1 and 1.2 in STREAM_CRYPTO_METHOD_TLS_CLIENT

    //so add them back in manually if we can

    if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) {

    $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;

    $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT;

    }


    // Begin encrypted connection

    if (!stream_socket_enable_crypto(

    $this->smtp_conn,

    true,

    $crypto_method

    )) {

    return false;

    }

    return true;

    }

    ```


    If indeed it is outside of Perch, any pointers for updating my TLS version to v1.1 or v1.2 would be very much appreciated.


    Thanks!


    Martin.

    It seems I marked this thread as resolved somehow. I've found a checkbox to mark it as unresolved again so hopefully it'll be picked up :)


    Does anyone know how to delete tags in the Member's app?

    In the Members app, I expected when the last member with a particular tag was deleted, the tag would also disappear, but it doesn't. Is there any way to force the matter? I can't find anywhere in the interface to do this. I could do it in the database, but that feels like the wrong way to go about it. Thanks for any pointers :burd1: