Forum
perch_content_custom ignoring 'start' instruction
Hi
I've been staring at this bit of code until it's burned into the back of my eyeballs, but I can't see what's wrong.
I have a page where I list podcasts. There's one panel, with the latest one, which is pulled out separately ( count => 1). Then there's a second call, which gets the rest, but aims to get them from the second onwards. Here's the code.
<?php
perch_content_custom('Analysis', array(
'template' => '_podcast_listing.html',
'page' => '/topics.php',
'category' => "types/podcast",
'count' => 14,
'start' => 2,
'paginate' => true,
));
?>
For some reason, the 'start' => 2 instruction is being ignored, and so the first entry is being repeated on the page. I changed the 'count'=>15 instruction to 14 to check that this was actually the correct call, on the correct page, and it was.
Diagnostics info below:
Thanks - M
PERCH INFORMATION
Perch: 2.8.29 Production mode: Production (100) Installed apps: content (2.8.29), assets (2.8.29), categories (2.8.29), perch_blog (4.1), perch_mailchimp (2.0.1), perch_podcasts (1.0) DB driver: PDO DB tables: innoforum_blog_authors (3), innoforum_blog_categories (2), innoforum_blog_comments (0), innoforum_blog_posts (7), innoforum_blog_posts_to_categories (12), innoforum_blog_posts_to_tags (0), innoforum_blog_sections (1), innoforum_blog_tags (0), innoforum_content_index (1961), innoforum_content_items (384), innoforum_content_regions (42), innoforum_navigation (0), innoforum_navigation_pages (0), innoforum_page_templates (4), innoforum_pages (21), innoforum_resource_log (2047), innoforum_resource_tags (0), innoforum_resources (222), innoforum_resources_to_tags (0), innoforum_settings (24), innoforum_user_privileges (31), innoforum_user_role_privileges (33), innoforum_user_roles (2), innoforum_users (3), pagecount (46707), perch2_categories (9), perch2_category_counts (0), perch2_category_sets (2), perch2_content_index (184626), perch2_content_items (11642), perch2_content_regions (631), perch2_mailchimp_campaigns (32), perch2_mailchimp_history (1), perch2_mailchimp_log (184), perch2_mailchimp_stats (1), perch2_mailchimp_subscribers (6645), perch2_navigation (0), perch2_navigation_pages (0), perch2_page_templates (13), perch2_pages (238), perch2_podcasts (0), perch2_podcasts_downloads (0), perch2_podcasts_episodes (0), perch2_resource_log (39822), perch2_resource_tags (11), perch2_resources (5379), perch2_resources_to_tags (32), perch2_settings (32), perch2_user_privileges (101), perch2_user_role_privileges (31), perch2_user_roles (2), perch2_users (9) Users: 9 App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_mailchimp', 'perch_podcasts' ); Scheduled tasks for perch_blog: delete_spam_comments (1440 mins) Scheduled tasks for perch_mailchimp: update_list_stats (60 mins) Editor plug-ins: ckeditor, tinymce, markitup H1: 48c61480a1cf7e355ed762268314738d L1: f149a134c5a4fceb641508ab17a32e45 F1: 2edba60ed1f613d6dd804feb202456a2 headerColour: #ffffff content_singlePageEdit: 1 helpURL: siteURL: / hideBranding: 1 content_collapseList: 1 lang: en-gb update_2.6.6: done latest_version: 2.8.15 on_sale_version: 2.8.29 headerScheme: light dashboard: 1 hide_pwd_reset: 0 content_hideNonEditableRegions: 0 content_frontend_edit: 0 logoPath: /perch/resources/daisywheel-transp@250.png perch_mailchimp_secret: b99d28cd86348f066e85f1ebc44b19a2 perch_mailchimp_update: 2.0 perch_mailchimp_api_key: 60b4a0c6acd8e4174e18acf49a4e5ce1-us3 perch_mailchimp_list_id: 2689fd4178 perch_mailchimp_campaign_url: /mailchimp/campaign.php?s={campaignSlug} update_2.7.4: done update_2.8.8: done update_2.8.17: done update_2.8.19: done update_2.8.29: done PERCH_DEVELOPMENT: 10 PERCH_STAGING: 50 PERCH_PRODUCTION: 100 PERCH_DB_USERNAME: db193508 PERCH_DB_SERVER: [never mind] PERCH_DB_DATABASE: db193508_innoforum PERCH_DB_PREFIX: perch2_ PERCH_TZ: UTC PERCH_EMAIL_FROM: mallen@daisywheelinteractive.com PERCH_EMAIL_FROM_NAME: Mallen Baker PERCH_LOGINPATH: /perch PERCH_PATH: /nfs/c11/h01/mnt/193508/domains/[never mind]/html/perch PERCH_CORE: /nfs/c11/h01/mnt/193508/domains/[never mind]/html/perch/core PERCH_RESFILEPATH: /nfs/c11/h01/mnt/193508/domains/[never mind]/html/perch/resources PERCH_RESPATH: /perch/resources PERCH_HTML5: 1 PERCH_RUNWAY: PERCH_ERROR_MODE: DIE PERCH_DATE_LONG: %d %B %Y PERCH_DATE_SHORT: %d %b %Y PERCH_TIME_SHORT: %H:%M PERCH_TIME_LONG: %H:%M:%S PERCH_RUNWAY_ROUTED: PERCH_STRONG_PASSWORDS: PERCH_DEBUG: PERCH_PREVIEW_ARG: preview PERCH_TEMPLATE_PATH: /nfs/c11/h01/mnt/193508/domains/[never mind]/html/perch/templates PERCH_DEFAULT_DOC: index.php PERCH_DEFAULT_EXT: .php PERCH_PRODUCTION_MODE: 100 PERCH_RWD: PERCH_HTML_ENTITIES: PERCH_SSL: PERCH_STRIPSLASHES: PERCH_PROGRESSIVE_FLUSH: 1 PERCH_PARANOID: PERCH_FORCE_SECURE_COOKIES: PERCH_PASSWORD_MIN_LENGTH: 6 PERCH_MAX_FAILED_LOGINS: 10 PERCH_AUTH_LOCKOUT_DURATION: 1 HOUR PERCH_VERIFY_UPLOADS: PERCH_AUTH_PLUGIN: PERCH_DB_CHARSET: utf8 PERCH_DB_PORT: PERCH_DB_SOCKET: PERCH_SESSION_TIMEOUT_MINS: 20 HOSTING SETTINGS
PHP: 5.5.31 Zend: 2.5.0 OS: Linux SAPI: cgi-fcgi Safe mode: not detected MySQL client: 5.5.47 MySQL server: 5.1.72-rel14.10 Free disk space: 6.04 TB Extensions: Core, date, ereg, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dba, dom, hash, fileinfo, filter, ftp, gd, gettext, SPL, iconv, session, intl, json, ldap, mbstring, mcrypt, standard, mysqlnd, mysqli, mysql, PDO, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, pspell, Reflection, imap, SimpleXML, soap, sockets, exif, tokenizer, wddx, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, cgi-fcgi, mhash GD: Yes ImageMagick: No PHP max upload size: 10M PHP max form post size: 99M PHP memory limit: 99M Total max uploadable file size: 10M Resource folder writeable: Yes Session timeout: 24 minutes Native JSON: Yes Filter functions: Yes Transliteration functions: Yes PATH: /usr/local/bin:/usr/bin:/bin REDIRECT_HANDLER: php-latest REDIRECT_STATUS: 200 UNIQUE_ID: Vx97Akgv9BEAABnqSD8AAAEJ SCRIPT_URL: /perch/core/settings/diagnostics/ SCRIPT_URI: https://[never mind]/perch/core/settings/diagnostics/ WM_UCONTROL_XMLRPC_SERVER: https://10.0.0.13 ACCESS_DOMAIN: [never mind] DATABASE_SERVER: [never mind] SITE_ROOT: /home/193508 SITE_CGIROOT: /home/193508/cgi-bin SITE_HTMLROOT: /home/193508/[never mind]/html PHPRC: /home/193508/etc/ HTTP_HOST: [never mind] HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8 HTTP_CONNECTION: keep-alive HTTP_COOKIE: _ga=GA1.3.590073585.1397207860; _gat=1; __atuvc=8%7C41%2C5%7C42%2C18%7C43%2C5%7C44%2C6%7C45; __smToken=YgnxD3Br5M1lQaSsllt5ZYfP; cmsa=1; PHPSESSID=fb53c5ebe4648c06d7c07f4fd762678f HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/601.5.17 (KHTML, like Gecko) Version/9.1 Safari/601.5.17 HTTP_ACCEPT_LANGUAGE: en-us HTTP_REFERER: https://[never mind]/perch/core/settings/diagnostics/ HTTP_ACCEPT_ENCODING: gzip, deflate SERVER_SIGNATURE: <address>Apache/2.2.22 Server at [never mind] Port 80</address> SERVER_SOFTWARE: Apache/2.2.22 SERVER_NAME: [nevermind] SERVER_ADDR: 72.47.244.136 SERVER_PORT: 80 REMOTE_ADDR: 109.147.110.98 DOCUMENT_ROOT: /home/193508/domains/[never mind]/html SERVER_ADMIN: webmaster@[never mind] SCRIPT_FILENAME: /home/193508/domains/[never mind]/html/perch/core/settings/diagnostics/index.php REMOTE_PORT: 63570 REDIRECT_QUERY_STRING: extended REDIRECT_URL: /perch/core/settings/diagnostics/index.php GATEWAY_INTERFACE: CGI/1.1 SERVER_PROTOCOL: HTTP/1.1 REQUEST_METHOD: GET QUERY_STRING: extended REQUEST_URI: /perch/core/settings/diagnostics/?extended SCRIPT_NAME: /perch/core/settings/diagnostics/index.php ORIG_SCRIPT_FILENAME: /etc/apache2/gs-bin/php-latest ORIG_PATH_INFO: /perch/core/settings/diagnostics/index.php ORIG_PATH_TRANSLATED: /home/193508/domains/[never mind]/html/perch/core/settings/diagnostics/index.php ORIG_SCRIPT_NAME: /gs-bin/php-latest PHP_SELF: /perch/core/settings/diagnostics/index.php REQUEST_TIME_FLOAT: 1461680898.1678 REQUEST_TIME: 1461680898 argc: 1
Hi Mallen,
To use
start
I think you need to sort by something first, which might be where the issue is. So something like:Or whatever
id
you want to sort onstart
is ignored if you're using pagination. The pagination has to control the start position, otherwise you'd never be able to view page 2.Ah, right - thanks. On to Plan B then.