Column layouts disappearing with PHP ver change

Hello, I’m working on an issue that appears when I upgrade a certain client site to PHP v7.x and I’d love some help. This is time sensitive as my server is removing the option to use PHP v5.x from the server at year’s end and this is an important site. This is all my fault, as I dropped the ball when I first heard about the issue a few months ago.

I’ve isolated down to an issue loading the ‘Bootstrap3’ grid layout. The code in the ‘page_theme.php’ appears correctly, but for some reason Bootstrap isn’t loading.

protected $pThemeGridFrameworkHandle = ‘bootstrap3’;

I’ve compared HTML and when I upgrade to PHP 7.x my HTML is missing code like :
<div class=“container”><div class=“row”><div class=“col-sm-12”><div class=“row”><div class=“col-sm-6”>

I literally found a place where that block of HTML was missing.

I’ve done a test and when I try to add a new layout in PHP 7.x, I don’t have ‘Twitter Bootstrap’ in the ‘Grids’ dropdown. But in PHP 5.x it appears.

Any ideas how I can make it so that I don’t have to re-establish column layouts on nearly a hundred pages?

This is using the Creative theme. I did ask Ivan’s help in the summer and he agreed to help but then I didn’t get back to him and I’ve asked him again but still waiting.

Which version of concrete are you using?
Have you tried switching to the Elemental Theme?
Are there any errors displayed in the browser console?
Do you have a page URL to share with us that shows the problem

Thanks for the reply! The C5 version is the latest v8.5.6 and there is an error in the console when I try to edit a layout (500 error for the popup loading) but not before. This is the site: https://cowichantribes.com/

I’ve just tried to create a new page with the elemental theme and it seems to load Twitter Bootstrap as an option in the ‘Grids’ dropdown when adding new layout. Something I don’t have with the Creative theme.

Okay so we can assume this is being caused by your theme, can you post the contents of your ‘page_theme.php’ file from your Creative theme, maybe we can spot a problem in there.

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)

<?php

namespace Concrete\Package\Creative\Theme\Creative;
defined(‘C5_EXECUTE’) or die(_(“Access Denied.”));

use Concrete\Core\Page\Theme\Theme;

class PageTheme extends Theme
{
public function registerAssets()
{
//$this->providesAsset(‘javascript’, ‘bootstrap/’);
$this->providesAsset(‘css’, 'bootstrap/
’);
$this->providesAsset(‘css’, ‘blocks/form’);
$this->providesAsset(‘css’, ‘blocks/social_links’);
$this->providesAsset(‘css’, ‘blocks/share_this_page’);
$this->providesAsset(‘css’, ‘blocks/feature’);
$this->providesAsset(‘css’, ‘blocks/testimonial’);
$this->providesAsset(‘css’, ‘blocks/date_navigation’);
$this->providesAsset(‘css’, ‘blocks/topic_list’);
$this->providesAsset(‘css’, ‘blocks/faq’);
$this->providesAsset(‘css’, ‘blocks/tags’);
$this->providesAsset(‘css’, ‘core/frontend/*’);
$this->providesAsset(‘css’, ‘blocks/feature/templates/hover_description’);

    $this->providesAsset('css', 'blocks/event_list');

    $this->requireAsset('css', 'font-awesome');
    $this->requireAsset('javascript', 'jquery');
    $this->requireAsset('javascript', 'picturefill');
    $this->requireAsset('javascript-conditional', 'html5-shiv');
    $this->requireAsset('javascript-conditional', 'respond');
}

protected $pThemeGridFrameworkHandle = 'bootstrap3';

public function getThemeName()
{
    return t('Creative');
}

public function getThemeDescription()
{
    return t('Creative template');
}

public function getThemeBlockClasses()
{
    return array(
        'feature' => array('feature-home-page'),
        'page_list' => array(
            'recent-blog-entry',
            'blog-entry-list',
            'page-list-with-buttons',
            'block-sidebar-wrapped',
        ),
        'next_previous' => array('block-sidebar-wrapped'),
        'share_this_page' => array('block-sidebar-wrapped'),
        'content' => array(
            'block-sidebar-wrapped',
            'block-sidebar-padded',
        ),
        'date_navigation' => array('block-sidebar-padded'),
        'topic_list' => array('block-sidebar-wrapped'),
        'testimonial' => array('testimonial-bio'),
        'image' => array(
            'image-right-tilt',
            'image-circle',
        ),
    );
}

public function getThemeAreaClasses()
{
    return array(
        'Page Footer' => array('area-content-accent'),
    );
}

public function getThemeDefaultBlockTemplates()
{
    return array(
        'calendar' => 'bootstrap_calendar.php'
    );
}

public function getThemeResponsiveImageMap()
{
    return array(
        'large' => '900px',
        'medium' => '768px',
        'small' => '0',
    );
}

public function getThemeEditorClasses()
{
    return array(
        array('title' => t('Thin Text'), 'menuClass' => '', 'spanClass' => 'thin-text', 'forceBlock' => 1),
        array('title' => t('Uppercase Text'), 'menuClass' => '', 'spanClass' => 't', 'forceBlock' => 1),
        array('title' => t('Thin H2'), 'menuClass' => '', 'spanClass' => 'thin-h2', 'forceBlock' => 1),
        array('title' => t('Thin Big H1'), 'menuClass' => '', 'spanClass' => 'thin-h1', 'forceBlock' => 1),
        array('title' => t('Image Caption'), 'menuClass' => 'image-caption', 'spanClass' => 'image-caption', 'forceBlock' => '-1'),
        array('title' => t('Default Button'), 'menuClass' => '', 'spanClass' => 'btn btn-default', 'forceBlock' => '-1'),
        array('title' => t('Left side Button'), 'menuClass' => '', 'spanClass' => 'btn btn-left-side', 'forceBlock' => '-1'),
        array('title' => t('Light Button'), 'menuClass' => '', 'spanClass' => 'btn btn-light', 'forceBlock' => '-1'),
        array('title' => t('Success Button'), 'menuClass' => '', 'spanClass' => 'btn btn-success', 'forceBlock' => '-1'),
        array('title' => t('Medium Button'), 'menuClass' => '', 'spanClass' => 'medium-btn', 'forceBlock' => '-1'),
        array('title' => t('Big Button'), 'menuClass' => '', 'spanClass' => 'big-btn', 'forceBlock' => '-1'),
        array('title' => t('Stride Button'), 'menuClass' => '', 'spanClass' => 'btn stride-btn', 'forceBlock' => '-1'),
        array('title' => t('Success Alert'), 'menuClass' => '', 'spanClass' => 'alert alert-success', 'forceBlock' => '-1'),
        array('title' => t('Info Alert'), 'menuClass' => '', 'spanClass' => 'alert alert-info', 'forceBlock' => '-1'),
        array('title' => t('Warning Alert'), 'menuClass' => '', 'spanClass' => 'alert alert-warning', 'forceBlock' => '-1'),
        array('title' => t('Danger Alert'), 'menuClass' => '', 'spanClass' => 'alert alert-danger', 'forceBlock' => '-1'),
                    array('title' => t('Font Size 14'), 'menuClass' => 'fs14', 'spanClass' => 'fs14', 'forceBlock' => 1),
        array('title' => t('Font Size 16'), 'menuClass' => 'fs16', 'spanClass' => 'fs16', 'forceBlock' => 0),
        array('title' => t('Font Size 18'), 'menuClass' => 'fs18', 'spanClass' => 'fs18', 'forceBlock' => 0),
        array('title' => t('Font Size 20'), 'menuClass' => 'fs20', 'spanClass' => 'fs20', 'forceBlock' => 0),
        array('title' => t('Font Size 22'), 'menuClass' => 'fs22', 'spanClass' => 'fs22', 'forceBlock' => 0),
        array('title' => t('Font Size 24'), 'menuClass' => 'fs24', 'spanClass' => 'fs24', 'forceBlock' => 0),
        array('title' => t('Font Size 26'), 'menuClass' => 'fs26', 'spanClass' => 'fs26', 'forceBlock' => 0),
        array('title' => t('Font Size 28'), 'menuClass' => 'fs28', 'spanClass' => 'fs28', 'forceBlock' => 0)
    );
}

public function getThemeAreaLayoutPresets()
{
    $presets = array(
        array(
            'handle' => 'left_sidebar',
            'name' => 'Left Sidebar',
            'container' => '<div class="row"></div>',
            'columns' => array(
                '<div class="col-sm-4"></div>',
                '<div class="col-sm-8"></div>'
            ),
        ),
        array(
            'handle' => 'right_sidebar',
            'name' => 'Right Sidebar',
            'container' => '<div class="row"></div>',
            'columns' => array(
                '<div class="col-sm-8"></div>',
                '<div class="col-sm-4"></div>'
            ),
        )
    );
    return $presets;
}

}

Ok, will do. Thanks!

<?php namespace Concrete\Package\Creative\Theme\Creative; defined('C5_EXECUTE') or die(_("Access Denied.")); use Concrete\Core\Page\Theme\Theme; class PageTheme extends Theme { public function registerAssets() { //$this->providesAsset('javascript', 'bootstrap/*'); $this->providesAsset('css', 'bootstrap/*'); $this->providesAsset('css', 'blocks/form'); $this->providesAsset('css', 'blocks/social_links'); $this->providesAsset('css', 'blocks/share_this_page'); $this->providesAsset('css', 'blocks/feature'); $this->providesAsset('css', 'blocks/testimonial'); $this->providesAsset('css', 'blocks/date_navigation'); $this->providesAsset('css', 'blocks/topic_list'); $this->providesAsset('css', 'blocks/faq'); $this->providesAsset('css', 'blocks/tags'); $this->providesAsset('css', 'core/frontend/*'); $this->providesAsset('css', 'blocks/feature/templates/hover_description'); $this->providesAsset('css', 'blocks/event_list'); $this->requireAsset('css', 'font-awesome'); $this->requireAsset('javascript', 'jquery'); $this->requireAsset('javascript', 'picturefill'); $this->requireAsset('javascript-conditional', 'html5-shiv'); $this->requireAsset('javascript-conditional', 'respond'); } protected $pThemeGridFrameworkHandle = 'bootstrap3'; public function getThemeName() { return t('Creative'); } public function getThemeDescription() { return t('Creative template'); } public function getThemeBlockClasses() { return array( 'feature' => array('feature-home-page'), 'page_list' => array( 'recent-blog-entry', 'blog-entry-list', 'page-list-with-buttons', 'block-sidebar-wrapped', ), 'next_previous' => array('block-sidebar-wrapped'), 'share_this_page' => array('block-sidebar-wrapped'), 'content' => array( 'block-sidebar-wrapped', 'block-sidebar-padded', ), 'date_navigation' => array('block-sidebar-padded'), 'topic_list' => array('block-sidebar-wrapped'), 'testimonial' => array('testimonial-bio'), 'image' => array( 'image-right-tilt', 'image-circle', ), ); } public function getThemeAreaClasses() { return array( 'Page Footer' => array('area-content-accent'), ); } public function getThemeDefaultBlockTemplates() { return array( 'calendar' => 'bootstrap_calendar.php' ); } public function getThemeResponsiveImageMap() { return array( 'large' => '900px', 'medium' => '768px', 'small' => '0', ); } public function getThemeEditorClasses() { return array( array('title' => t('Thin Text'), 'menuClass' => '', 'spanClass' => 'thin-text', 'forceBlock' => 1), array('title' => t('Uppercase Text'), 'menuClass' => '', 'spanClass' => 't', 'forceBlock' => 1), array('title' => t('Thin H2'), 'menuClass' => '', 'spanClass' => 'thin-h2', 'forceBlock' => 1), array('title' => t('Thin Big H1'), 'menuClass' => '', 'spanClass' => 'thin-h1', 'forceBlock' => 1), array('title' => t('Image Caption'), 'menuClass' => 'image-caption', 'spanClass' => 'image-caption', 'forceBlock' => '-1'), array('title' => t('Default Button'), 'menuClass' => '', 'spanClass' => 'btn btn-default', 'forceBlock' => '-1'), array('title' => t('Left side Button'), 'menuClass' => '', 'spanClass' => 'btn btn-left-side', 'forceBlock' => '-1'), array('title' => t('Light Button'), 'menuClass' => '', 'spanClass' => 'btn btn-light', 'forceBlock' => '-1'), array('title' => t('Success Button'), 'menuClass' => '', 'spanClass' => 'btn btn-success', 'forceBlock' => '-1'), array('title' => t('Medium Button'), 'menuClass' => '', 'spanClass' => 'medium-btn', 'forceBlock' => '-1'), array('title' => t('Big Button'), 'menuClass' => '', 'spanClass' => 'big-btn', 'forceBlock' => '-1'), array('title' => t('Stride Button'), 'menuClass' => '', 'spanClass' => 'btn stride-btn', 'forceBlock' => '-1'), array('title' => t('Success Alert'), 'menuClass' => '', 'spanClass' => 'alert alert-success', 'forceBlock' => '-1'), array('title' => t('Info Alert'), 'menuClass' => '', 'spanClass' => 'alert alert-info', 'forceBlock' => '-1'), array('title' => t('Warning Alert'), 'menuClass' => '', 'spanClass' => 'alert alert-warning', 'forceBlock' => '-1'), array('title' => t('Danger Alert'), 'menuClass' => '', 'spanClass' => 'alert alert-danger', 'forceBlock' => '-1'), array('title' => t('Font Size 14'), 'menuClass' => 'fs14', 'spanClass' => 'fs14', 'forceBlock' => 1), array('title' => t('Font Size 16'), 'menuClass' => 'fs16', 'spanClass' => 'fs16', 'forceBlock' => 0), array('title' => t('Font Size 18'), 'menuClass' => 'fs18', 'spanClass' => 'fs18', 'forceBlock' => 0), array('title' => t('Font Size 20'), 'menuClass' => 'fs20', 'spanClass' => 'fs20', 'forceBlock' => 0), array('title' => t('Font Size 22'), 'menuClass' => 'fs22', 'spanClass' => 'fs22', 'forceBlock' => 0), array('title' => t('Font Size 24'), 'menuClass' => 'fs24', 'spanClass' => 'fs24', 'forceBlock' => 0), array('title' => t('Font Size 26'), 'menuClass' => 'fs26', 'spanClass' => 'fs26', 'forceBlock' => 0), array('title' => t('Font Size 28'), 'menuClass' => 'fs28', 'spanClass' => 'fs28', 'forceBlock' => 0) ); } public function getThemeAreaLayoutPresets() { $presets = array( array( 'handle' => 'left_sidebar', 'name' => 'Left Sidebar', 'container' => '
', 'columns' => array( '
', '
' ), ), array( 'handle' => 'right_sidebar', 'name' => 'Right Sidebar', 'container' => '
', 'columns' => array( '
', '
' ), ) ); return $presets; } }

Ok, here it is. Thanks!

<?php

namespace Concrete\Package\Creative\Theme\Creative;
defined(‘C5_EXECUTE’) or die(_(“Access Denied.”));

use Concrete\Core\Page\Theme\Theme;

class PageTheme extends Theme
{
public function registerAssets()
{
//$this->providesAsset(‘javascript’, ‘bootstrap/’);
$this->providesAsset(‘css’, 'bootstrap/
’);
$this->providesAsset(‘css’, ‘blocks/form’);
$this->providesAsset(‘css’, ‘blocks/social_links’);
$this->providesAsset(‘css’, ‘blocks/share_this_page’);
$this->providesAsset(‘css’, ‘blocks/feature’);
$this->providesAsset(‘css’, ‘blocks/testimonial’);
$this->providesAsset(‘css’, ‘blocks/date_navigation’);
$this->providesAsset(‘css’, ‘blocks/topic_list’);
$this->providesAsset(‘css’, ‘blocks/faq’);
$this->providesAsset(‘css’, ‘blocks/tags’);
$this->providesAsset(‘css’, ‘core/frontend/*’);
$this->providesAsset(‘css’, ‘blocks/feature/templates/hover_description’);

    $this->providesAsset('css', 'blocks/event_list');

    $this->requireAsset('css', 'font-awesome');
    $this->requireAsset('javascript', 'jquery');
    $this->requireAsset('javascript', 'picturefill');
    $this->requireAsset('javascript-conditional', 'html5-shiv');
    $this->requireAsset('javascript-conditional', 'respond');
}

protected $pThemeGridFrameworkHandle = 'bootstrap3';

public function getThemeName()
{
    return t('Creative');
}

public function getThemeDescription()
{
    return t('Creative template');
}

public function getThemeBlockClasses()
{
    return array(
        'feature' => array('feature-home-page'),
        'page_list' => array(
            'recent-blog-entry',
            'blog-entry-list',
            'page-list-with-buttons',
            'block-sidebar-wrapped',
        ),
        'next_previous' => array('block-sidebar-wrapped'),
        'share_this_page' => array('block-sidebar-wrapped'),
        'content' => array(
            'block-sidebar-wrapped',
            'block-sidebar-padded',
        ),
        'date_navigation' => array('block-sidebar-padded'),
        'topic_list' => array('block-sidebar-wrapped'),
        'testimonial' => array('testimonial-bio'),
        'image' => array(
            'image-right-tilt',
            'image-circle',
        ),
    );
}

public function getThemeAreaClasses()
{
    return array(
        'Page Footer' => array('area-content-accent'),
    );
}

public function getThemeDefaultBlockTemplates()
{
    return array(
        'calendar' => 'bootstrap_calendar.php'
    );
}

public function getThemeResponsiveImageMap()
{
    return array(
        'large' => '900px',
        'medium' => '768px',
        'small' => '0',
    );
}

public function getThemeEditorClasses()
{
    return array(
        array('title' => t('Thin Text'), 'menuClass' => '', 'spanClass' => 'thin-text', 'forceBlock' => 1),
        array('title' => t('Uppercase Text'), 'menuClass' => '', 'spanClass' => 't', 'forceBlock' => 1),
        array('title' => t('Thin H2'), 'menuClass' => '', 'spanClass' => 'thin-h2', 'forceBlock' => 1),
        array('title' => t('Thin Big H1'), 'menuClass' => '', 'spanClass' => 'thin-h1', 'forceBlock' => 1),
        array('title' => t('Image Caption'), 'menuClass' => 'image-caption', 'spanClass' => 'image-caption', 'forceBlock' => '-1'),
        array('title' => t('Default Button'), 'menuClass' => '', 'spanClass' => 'btn btn-default', 'forceBlock' => '-1'),
        array('title' => t('Left side Button'), 'menuClass' => '', 'spanClass' => 'btn btn-left-side', 'forceBlock' => '-1'),
        array('title' => t('Light Button'), 'menuClass' => '', 'spanClass' => 'btn btn-light', 'forceBlock' => '-1'),
        array('title' => t('Success Button'), 'menuClass' => '', 'spanClass' => 'btn btn-success', 'forceBlock' => '-1'),
        array('title' => t('Medium Button'), 'menuClass' => '', 'spanClass' => 'medium-btn', 'forceBlock' => '-1'),
        array('title' => t('Big Button'), 'menuClass' => '', 'spanClass' => 'big-btn', 'forceBlock' => '-1'),
        array('title' => t('Stride Button'), 'menuClass' => '', 'spanClass' => 'btn stride-btn', 'forceBlock' => '-1'),
        array('title' => t('Success Alert'), 'menuClass' => '', 'spanClass' => 'alert alert-success', 'forceBlock' => '-1'),
        array('title' => t('Info Alert'), 'menuClass' => '', 'spanClass' => 'alert alert-info', 'forceBlock' => '-1'),
        array('title' => t('Warning Alert'), 'menuClass' => '', 'spanClass' => 'alert alert-warning', 'forceBlock' => '-1'),
        array('title' => t('Danger Alert'), 'menuClass' => '', 'spanClass' => 'alert alert-danger', 'forceBlock' => '-1'),
                    array('title' => t('Font Size 14'), 'menuClass' => 'fs14', 'spanClass' => 'fs14', 'forceBlock' => 1),
        array('title' => t('Font Size 16'), 'menuClass' => 'fs16', 'spanClass' => 'fs16', 'forceBlock' => 0),
        array('title' => t('Font Size 18'), 'menuClass' => 'fs18', 'spanClass' => 'fs18', 'forceBlock' => 0),
        array('title' => t('Font Size 20'), 'menuClass' => 'fs20', 'spanClass' => 'fs20', 'forceBlock' => 0),
        array('title' => t('Font Size 22'), 'menuClass' => 'fs22', 'spanClass' => 'fs22', 'forceBlock' => 0),
        array('title' => t('Font Size 24'), 'menuClass' => 'fs24', 'spanClass' => 'fs24', 'forceBlock' => 0),
        array('title' => t('Font Size 26'), 'menuClass' => 'fs26', 'spanClass' => 'fs26', 'forceBlock' => 0),
        array('title' => t('Font Size 28'), 'menuClass' => 'fs28', 'spanClass' => 'fs28', 'forceBlock' => 0)
    );
}

public function getThemeAreaLayoutPresets()
{
    $presets = array(
        array(
            'handle' => 'left_sidebar',
            'name' => 'Left Sidebar',
            'container' => '<div class="row"></div>',
            'columns' => array(
                '<div class="col-sm-4"></div>',
                '<div class="col-sm-8"></div>'
            ),
        ),
        array(
            'handle' => 'right_sidebar',
            'name' => 'Right Sidebar',
            'container' => '<div class="row"></div>',
            'columns' => array(
                '<div class="col-sm-8"></div>',
                '<div class="col-sm-4"></div>'
            ),
        )
    );
    return $presets;
}

}

I see that the bootstrap javascript asset is commented out, is this something you have done?

No, it was always like that. I’ve tried it both ways. Doesn’t seem to make a difference. I’ve looked in ‘page_theme.php’ for a few other themes I’m using successfully on PHP 7 and they have the same.

Okay I can only think that you are having a clash of javascripts causing one of the bootstrap scripts to not get loaded properly, hence your console error message.
Just why PHP7 would cause that is a mystery at the moment though?

Thanks a lot for your help man! It’s quite the mystery for sure. That commented out line regarding bootstrap in the ‘page_theme.php’ is the same as it is in ‘elemental’ theme.

I’ve looked at the header and footer calls in PHP5 vs PHP7 and there are some differences for some reason. I wonder if one of the assets being called is not PHP7 compatible and that’s choking up the loading.

I’m not totally clear on what interaction there is between a ‘ThemeGridFramework’ and javascript. On both (PHP5/PHP7) versions there are all of the ‘boostrap/dropdown.js’, ‘boostrap/tooltip.js’, etc. files loading.

I have sent you a Private Message