Forum
Issue with Blocks on different post type templates
Hi,
I am not sure whether this is a bug with my template code or the blog application, but it seems that when first choosing a post template that includes blocks they do not load as expected.
I've taken a quick screen capture to show the steps to reproduce: https://www.dropbox.com/s/gr3rhy9zlb6u5sj/perch_blog_blocks.mov?dl=0
Here is the post template in question:
<perch:template path="blog/partials/_post_main.html" />
<perch:blocks divider-before="List Sections">
<perch:block type="list_item" label="List Item">
<perch:blog id="section_title" type="text" label="Title" title="true" size="xl" required="true" suppress="true" />
<perch:blog id="section_content" type="textarea" label="Content" editor="redactor" html="true" bucket="editor" imagewidth="655" required="true" suppress="true" />
</perch:block>
</perch:blocks>
<perch:template path="blog/partials/_post_meta.html" />
Post Main:
<perch:blog id="postTitle" type="text" label="Title" required="true" size="xl autowidth" order="1" suppress="true" />
<perch:blog id="postLead" type="textarea" label="Lead" size="xs" required="true" suppress="true" help="This will also be the preview text shown on the main blog page." />
<perch:blog id="postDescHTML" type="textarea" label="Post" editor="redactor" html="true" bucket="editor" imagewidth="655" required="true" suppress="true" />
Post Meta:
<perch:blog id="preview_image" type="image" label="Preview" bucket="blog" crop="true" width="350" height="550" suppress="true" divider-before="Preview" help="Thumbnail displayed on the main blog page." />
<perch:blog id="preview_image" type="image" bucket="blog" crop="true" width="350" height="220" suppress="true" />
<perch:categories id="categories" set="blog" label="Categories" display-as="checkboxes" divider-before="Post Options" suppress="true" />
<perch:blog id="postDateTime" type="date" label="Date" time="true" suppress="true" help="Set this to a future date / time to schedule a post." />
Diagnostics:
Perch: 2.8.34
Production mode: Development (10)
Installed apps: content (2.8.34), assets (2.8.34), categories (2.8.34), root_analytics (1.1.0), perch_blog (5.0), root_heartbeat (1.0.1)
DB driver: PDO
DB tables: perch2_blog_authors (1), perch2_blog_comments (0), perch2_blog_index (96), perch2_blog_posts (4), perch2_blog_posts_to_tags (0), perch2_blog_sections (1), perch2_blog_tags (0), perch2_blogs (1), perch2_categories (3), perch2_category_counts (1), perch2_category_sets (1), perch2_content_index (212), perch2_content_items (32), perch2_content_regions (12), perch2_navigation (0), perch2_navigation_pages (0), perch2_page_templates (2), perch2_pages (2), perch2_resource_log (22), perch2_resource_tags (0), perch2_resources (20), perch2_resources_to_tags (0), perch2_root_analytics_cache (3), perch2_settings (31), perch2_user_passwords (0), perch2_user_privileges (35), perch2_user_role_privileges (16), perch2_user_roles (2), perch2_users (1)
Users: 1
PHPMailer: 5.2.21
App runtimes:
<?php
$apps_list = array(
'content',
'categories',
'perch_blog',
'root_analytics'
);
Scheduled tasks for perch_blog: delete_spam_comments (1440 mins)
Scheduled tasks for root_analytics: root_analytics_fetch_comparisons (1440 mins)
Scheduled tasks for root_heartbeat: root_heartbeat_broadcast_status (1440 mins)
Editor plug-ins: markitup, redactor
H1: 9cd3756f4c13c8e2246771908bf99659
L1: 9806c53415b42db0c289fe14fc0a6986
F1: 6a33f95eca3667f9e0c39bf5ca2980fe
headerColour: #0B6271
content_singlePageEdit: 1
helpURL: mailto:design@rootstudio.co.uk
siteURL: /
hideBranding: 1
content_collapseList: 1
lang: en-gb
update_2.8.34: done
latest_version: 2.8.15
on_sale_version: 2.8.34
headerScheme: dark
root_analytics_namespace: Root Analytics
root_analytics_view_id:
root_analytics_credentials_json:
root_analytics_time_period: 90
root_analytics_ua:
root_heartbeat_uid:
root_heartbeat_signature:
root_heartbeat_master_server:
dashboard: 0
hide_pwd_reset: 0
content_hideNonEditableRegions: 0
content_frontend_edit: 0
logoPath: /admin/resources/coli-avatar3x.png
perch_blog_update: 5.0.1
perch_blog_post_url: /blog/post.php?s={postSlug}
perch_blog_site_name:
perch_blog_slug_format: %Y-%m-%d-{postTitle}
perch_blog_akismet_key:
perch_blog_max_spam_days: 0
perch_blog_comment_notify: 0
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_TZ: Europe/Moscow
PERCH_LOGINPATH: /admin
PERCH_PATH: /Users/James/Repositories/Misha/Coli-Crocodile-Core-Site/build/admin
PERCH_CORE: /Users/James/Repositories/Misha/Coli-Crocodile-Core-Site/build/admin/core
PERCH_RESFILEPATH: /Users/James/Repositories/Misha/Coli-Crocodile-Core-Site/build/admin/resources
PERCH_RESPATH: /admin/resources
PERCH_HTML5: 1
PERCH_DB_USERNAME: root
PERCH_DB_SERVER: localhost
PERCH_DB_DATABASE: colic_perch
PERCH_DB_PREFIX: perch2_
PERCH_EMAIL_FROM: james@rootstudio.co.uk
PERCH_EMAIL_FROM_NAME: Root Studio
PERCH_DEBUG: 1
PERCH_PRODUCTION_MODE: 10
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_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: /Users/James/Repositories/Misha/Coli-Crocodile-Core-Site/build/admin/templates
PERCH_DEFAULT_DOC: index.php
PERCH_DEFAULT_EXT: .php
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: 7.0.13
Zend: 3.0.0
OS: Darwin
SAPI: cgi-fcgi
Safe mode: not detected
MySQL client: mysqlnd 5.0.12-dev - 20150407 - $Id: 241ae00989d1995ffcbbf63d579943635faf9972 $
MySQL server: 5.6.34
Free disk space: 318.13 GB
Extensions: Core, date, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dom, hash, fileinfo, filter, ftp, gd, SPL, iconv, intl, json, ldap, mbstring, session, standard, mysqlnd, PDO, pdo_mysql, pdo_sqlite, Phar, posix, readline, Reflection, mysqli, SimpleXML, soap, sockets, exif, tokenizer, wddx, xml, xmlreader, xmlwriter, xsl, zip, cgi-fcgi, imap, gettext, mcrypt, pgsql, pdo_pgsql, imagick, igbinary, memcached, xdebug
GD: Yes
ImageMagick: Yes
PHP max upload size: 32M
PHP max form post size: 32M
PHP memory limit: 128M
Total max uploadable file size: 32M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: Yes
PHP_FCGI_CHILDREN: 4
PWD: /Applications/MAMP/fcgi-bin
PHP_FCGI_MAX_REQUESTS: 200
__CF_USER_TEXT_ENCODING: 0x1F5:0x0:0x2
ORIG_SCRIPT_NAME: /fcgi-bin/php7.0.13.fcgi
ORIG_PATH_TRANSLATED: /Users/James/Repositories/Misha/Coli-Crocodile-Core-Site/build/admin/core/settings/diagnostics/index.php
ORIG_PATH_INFO: /admin/core/settings/diagnostics/index.php
ORIG_SCRIPT_FILENAME: /Applications/MAMP/fcgi-bin/php7.0.13.fcgi
SCRIPT_NAME: /admin/core/settings/diagnostics/index.php
REQUEST_URI: /admin/core/settings/diagnostics/?extended
QUERY_STRING: extended
REQUEST_METHOD: GET
SERVER_PROTOCOL: HTTP/1.1
GATEWAY_INTERFACE: CGI/1.1
REDIRECT_URL: /admin/core/settings/diagnostics/index.php
REDIRECT_QUERY_STRING: extended
REMOTE_PORT: 62976
SCRIPT_FILENAME: /Users/James/Repositories/Misha/Coli-Crocodile-Core-Site/build/admin/core/settings/diagnostics/index.php
SERVER_ADMIN: you@example.com
DOCUMENT_ROOT: /Users/James/Repositories/Misha/Coli-Crocodile-Core-Site/build
REMOTE_ADDR: ::1
SERVER_PORT: 80
SERVER_ADDR: ::1
SERVER_NAME: colicrocodile.local
SERVER_SOFTWARE: Apache
PATH: /usr/bin:/bin:/usr/sbin:/sbin
HTTP_ACCEPT_ENCODING: gzip, deflate
HTTP_ACCEPT_LANGUAGE: en-gb
HTTP_REFERER: https://colicrocodile.local/admin/core/settings/diagnostics/
HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/602.2.14 (KHTML, like Gecko) Version/10.0.1 Safari/602.2.14
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_UPGRADE_INSECURE_REQUESTS: 1
HTTP_CONNECTION: keep-alive
HTTP_COOKIE: _ga=GA1.2.288956060.1481538580; PHPSESSID=f06dbed7b2520b8a31ecc325fc0fc68e; cmsa=1; __insp_slim=1479725357427; __insp_norec_sess=true; __insp_nv=true; __insp_targlpt=Social%20Change%20UK%20%3A%3A%20Inspiring%20change%20in%20people%20and%20communities; __insp_targlpu=http%3A%2F%2Fsocial-change.local%2F; __insp_wid=1206163498
HTTP_HOST: colicrocodile.local
REDIRECT_STATUS: 200
REDIRECT_HANDLER: php-fastcgi
FCGI_ROLE: RESPONDER
PHP_SELF: /admin/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1484315134.08
REQUEST_TIME: 1484315134
argc: 1
Thanks!
Is this specific to using multiple post templates?
Yes, on sites with only post.html the blocks work fine. This is the first site with multiple post types.
Interesting! Thanks, I'll check it out.
Hey Drew,
Is there any news on this? Our client has also noticed the issue and has queried it with us.
Thanks!
Nope - but it's logged.
Awesome, thanks Drew :)