We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum
Runway: partial numeric slug matches multiple items when using 'match'=>'eq'
I have several list/detail pages which pull from collections by matching the item slug, like this:
$result = perch_collection('Product: '.$cat_title, [ 'template' =>'product/_detail_incl/_detail_'.$lang.'.html', 'filter'=>'slug', 'match'=>'eq', 'value'=>perch_get('slug'), 'skip-template' => true, 'return-html' => true, ]);
I get the slug using a route. For example, the route for one page is
I have two collection items with these slugs:
When I visit
/en/products/axles/4000-series-rigid I correctly get the first item, and
/en/products/axles/4000-series-rigid-tandem correctly shows the second item.
However, I just noticed that if I visit the URL
/en/products/axles/4000, BOTH collection items are matched and shown. There is no collection item with a "4000" slug. The strange thing is that these URLs correctly match nothing:
...etc. So it seems that for some reason, only giving the first, complete numeric part of the slug can somehow match multiple collection items. Might be a bug?
HEALTH CHECK Perch Runway is up to date PHP 5.6.14-1+deb.sury.org~trusty+1 is up to date MySQL 5.5.46-0ubuntu0.14.04.2 is up to date Image processing available SUMMARY INFORMATION Perch Runway: 2.8.31, PHP: 5.6.14-1+deb.sury.org~trusty+1, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 3c688b6bbc30d36af3ac34fdd4b7b5b787fe5555 $, with PDO Server OS: Linux, apache2handler Installed apps: content (2.8.31), assets (2.8.31), categories (2.8.31), perch_blog (5.0), perch_events (1.9.3), perch_forms (1.8.3) App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_blog', 'perch_events', 'perch_forms', ); PERCH_LOGINPATH: /at-admin PERCH_PATH: /var/www/public/axletech.dev/at-admin PERCH_CORE: /var/www/public/axletech.dev/at-admin/core PERCH_RESFILEPATH: /var/www/public/axletech.dev/at-admin/resources Image manipulation: GD Imagick PHP limits: Max upload 100M, Max POST 100M, Memory: 128M, Total max file upload: 100M F1: 2edba60ed1f613d6dd804feb202456a2 Resource folder writeable: Yes HTTP_HOST: axletech.dev DOCUMENT_ROOT: /var/www/public/axletech.dev REQUEST_URI: /at-admin/core/settings/diagnostics/ SCRIPT_NAME: /at-admin/core/settings/diagnostics/index.php
Want to reply to this thread?Login with Perch