Not a Bug


This is marked as not a bug with concrete5 core.

hasPageThemeGridFrameworkOffsetClasses

Permalink 4 0 Browser Info Environment
After upgrade to 5.7.5.1 following error exists:
"Call to a member function hasPageThemeGridFrameworkOffsetClasses() on a non-object "
in file:
updates/concrete5.7.5.1_remote_updater/concrete/src/Area/Layout/ThemeGridColumn.php:

(using add-on Simple Blog Setup and Blog page)


Status: Not a Bug
olafpeter
View Best Answer
ginrochiepvo replied on at Permalink Reply
ginrochiepvo
replace your
\concrete\src\Area\Layout\ThemeGridColumn.php
with this one

<?php
namespace Concrete\Core\Area\Layout;

use Concrete\Core\Html\Object\Collection;
use HtmlObject\Element;
use Loader;

class ThemeGridColumn extends Column
{

/**
* @var int
*/
public $arLayoutColumnSpan;

/**
* @var int
*/
public $arLayoutColumnOffset;

/**
* @param int $arLayoutColumnID
* @return static
*/
public static function getByID($arLayoutColumnID)
{
$db = Loader::db();
$row = $db->GetRow('select * from AreaLayoutThemeGridColumns where arLayoutColumnID = ?', array($arLayoutColumnID));
if (is_array($row) && $row['arLayoutColumnID']) {
$al = new static();
$al->loadBasicInformation($arLayoutColumnID);
$al->setPropertiesFromArray($row);
return $al;
}
}

/**
* @param Column $newAreaLayout
* @return ThemeGridColumn
*/
public function duplicate($newAreaLayout)
{
$areaLayoutColumnID = parent::duplicate($newAreaLayout);
$db = Loader::db();
$v = array($areaLayoutColumnID, $this->arLayoutColumnSpan, $this->arLayoutColumnOffset);
$db->Execute('insert into AreaLayoutThemeGridColumns (arLayoutColumnID, arLayoutColumnSpan, arLayoutColumnOffset) values (?, ?, ?)', $v);
$newAreaLayoutColumn = ThemeGridColumn::getByID($areaLayoutColumnID);
return $newAreaLayoutColumn;
}

protected function getSubAreaMaximumColumns()
{
$framework = $this->getAreaLayoutObject()->getThemeGridFrameworkObject();
if (is_object($framework) && $framework->supportsNesting()) {
return $framework->getPageThemeGridFrameworkNumColumns();
}
}


/**
* @param \SimpleXMLElement $node
*/
public function exportDetails($node)
{
$node->addAttribute('span', $this->arLayoutColumnSpan);
$node->addAttribute('offset', $this->arLayoutColumnOffset);
}

/**
* @return int
*/
public function getAreaLayoutColumnSpan()
{
return $this->arLayoutColumnSpan;
}

/**
* @return int
*/
public function getAreaLayoutColumnOffset()
{
return $this->arLayoutColumnOffset;
}

/**
* @return string
*/
public function getAreaLayoutColumnClass()
{
/**
* @var ThemeGridLayout $this->arLayout
*/
$gf = $this->arLayout->getThemeGridFrameworkObject();
if (is_object($gf)) {
$class = $gf->getPageThemeGridFrameworkColumnAdditionalClasses();
if ($class) {
$class .= ' ';
}

// the width parameter of the column becomes the span
$class .= $gf->getPageThemeGridFrameworkColumnClassForSpan($this->arLayoutColumnSpan);
return $class;
}
}

/**
* this returns offsets in the form of spans
* @return string
*/
public function getAreaLayoutColumnOffsetEditClass()
{
/**
* @var ThemeGridLayout $this->arLayout
*/
$gf = $this->arLayout->getThemeGridFrameworkObject();
if (is_object($gf)) {
$class = $gf->getPageThemeGridFrameworkColumnAdditionalClasses();
if ($class) {
$class .= ' ';
}

$class .= $gf->getPageThemeGridFrameworkColumnClassForSpan($this->arLayoutColumnOffset);
return $class;
}
}

public function getColumnHtmlObject()
{
$contents = $this->getContents();
return $this->getColumnElement($contents);
}

public function getColumnHtmlObjectEditMode()
{
$contents = $this->getContents(true);
return $this->getColumnElement($contents);
}
// FIXED BY GINRO CHIEPVO
// [email protected]
protected function getColumnElement($contents)
{
$element = new Element('div');
$element->addClass($this->getAreaLayoutColumnClass());
$gf = $this->arLayout->getThemeGridFrameworkObject();
if (@$gf->hasPageThemeGridFrameworkOffsetClasses() && $this->getAreaLayoutColumnOffset()) {
$element->addClass($this->getAreaLayoutColumnOffsetClass());
}
$element->setValue($contents);
if ($this->getAreaLayoutColumnOffset() > 0 && ([email protected]$gf->hasPageThemeGridFrameworkOffsetClasses())) {
$collection = new Collection();
$offset = new Element('div');
$offset->addClass($this->getAreaLayoutColumnOffsetClass())
->addClass('ccm-theme-grid-offset-column');
$collection[0] = $offset;
$collection[1] = $element;
return $collection;
} else {
return $element;
}
}

/**
* @return string
*/
// FIXED BY GINRO CHIEPVO
// [email protected]
public function getAreaLayoutColumnOffsetClass()
{
$gf = $this->arLayout->getThemeGridFrameworkObject();
if (is_object($gf)) {
// the width parameter of the column becomes the span
$class = $gf->getPageThemeGridFrameworkColumnOffsetAdditionalClasses();
if ($class) {
$class .= ' ';
}
if (@$gf->hasPageThemeGridFrameworkOffsetClasses()) {
$class .= $gf->getPageThemeGridFrameworkColumnClassForOffset($this->arLayoutColumnOffset);
} else {
$class .= $gf->getPageThemeGridFrameworkColumnClassForSpan($this->arLayoutColumnOffset);
}
return $class;
}
}

public function delete()
{
$db = Loader::db();
$db->Execute("delete from AreaLayoutThemeGridColumns where arLayoutColumnID = ?", array($this->arLayoutColumnID));
parent::delete();
}

/**
* @param int $span
*/
public function setAreaLayoutColumnSpan($span)
{
if (!$span) {
$span = 0;
}
$db = Loader::db();
$db->Execute('update AreaLayoutThemeGridColumns set arLayoutColumnSpan = ? where arLayoutColumnID = ?', array($span, $this->arLayoutColumnID));
$this->arLayoutColumnSpan = $span;
}

/**
* @param int $offset
*/
public function setAreaLayoutColumnOffset($offset)
{
if (!$offset) {
$offset = 0;
}
$db = Loader::db();
$db->Execute(
'update AreaLayoutThemeGridColumns set arLayoutColumnOffset = ? where arLayoutColumnID = ?',
array($offset, $this->arLayoutColumnID)
);
$this->arLayoutColumnOffset = $offset;
}

}
// FIXED BY GINRO CHIEPVO
// [email protected]
olafpeter replied on at Permalink Reply
olafpeter
Hi, thanks, but this doesn't work for me. With this patch there is actually no error message, but the site doesn't shown up clearly. Broken html code after
<div class="row">
          <div class="twelve columns content-box">
            <div class="inner">

-> the rest of the html code isn't generated and no debug information available
ginrochiepvo replied on at Permalink Reply
ginrochiepvo
i've noticed the bug yesterday
try to reinstall your concrete5
patch the file like i said last time
and make a new blank page.
at least you shold re-create your site after all
clearing all your data and make new one with the patch installed first.
ginrochiepvo replied on at Permalink Reply
ginrochiepvo
i've noticed the bug yesterday
try to reinstall your concrete5
patch the file like i said last time
and make a new blank page.
at least you shold re-create your site after all
clearing all your data and make new one with the patch installed first.
olafpeter replied on at Permalink Reply
olafpeter
Hi,
Is this your bugfix? Supress error messages an say: remove installation, install new and create sites new.
This is no good way to remove bugs, I'll give my PHP & mysql knowledge a chance to find another way.
amej16 replied on at Permalink Reply
Tnx man it works for me! You save me :)
m4r3x replied on at Permalink Reply
Having very same problem under new theme I tried to create using the tutorial from:
https://www.youtube.com/watch?t=593&v=vQm1QXN9OfI...

I get the error whenever I try to add or edit the 'Layout'. Adding blocks works OK.

Any word about what's going on? I would love to get into the source and find the solution, yet I'm just using concrete5 for few days so its fresh code for me.

Cheers,
M.
olafpeter replied on at Best Answer Permalink Reply
olafpeter
After updating organica theme to v2.1 the error has gone...
Storyteller replied on at Permalink Reply
Storyteller
After the upgrade there have been changes to the page_theme.php

There are few smaller changes and 3 new functions. These functions are:

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

public function getThemeDescription()
{
return t('Elegant, spacious theme with support for blogs, portfolios, layouts and more.');
}

and finally the main reason for this error:
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;
}

concrete5 Environment Information

# concrete5 Version
Core Version - 5.7.5.1
Version Installed - 5.7.5.1
Database Version - 20150713000000

# concrete5 Packages
Addons Lister (2.0.1), GalleryES (2.3.2), HTML+PHP Code Block (1.0.1), List files from set (1.0.8), Organica (2.0), Responsive Embed (1.0.0), Simple Blog setup (1.0.0), Tweet Feed Block Components (0.9.11).

# concrete5 Overrides
languages/ru_RU/LC_MESSAGES/messages.mo, languages/ru_RU/LC_MESSAGES, languages/ru_RU, languages/ja_JP/LC_MESSAGES/messages.mo, languages/ja_JP/LC_MESSAGES, languages/ja_JP, languages/fi_FI/LC_MESSAGES/messages.mo, languages/fi_FI/LC_MESSAGES, languages/fi_FI, languages/nl_NL/LC_MESSAGES/messages.mo, languages/nl_NL/LC_MESSAGES, languages/nl_NL, languages/tr_TR/LC_MESSAGES/messages.mo, languages/tr_TR/LC_MESSAGES, languages/tr_TR, languages/pt_BR/LC_MESSAGES/messages.mo, languages/pt_BR/LC_MESSAGES, languages/pt_BR, languages/sv_SE/LC_MESSAGES/messages.mo, languages/sv_SE/LC_MESSAGES, languages/sv_SE, languages/el_GR/LC_MESSAGES/messages.mo, languages/el_GR/LC_MESSAGES, languages/el_GR, languages/sl_SI/LC_MESSAGES/messages.mo, languages/sl_SI/LC_MESSAGES, languages/sl_SI, languages/it_IT/LC_MESSAGES/messages.mo, languages/it_IT/LC_MESSAGES, languages/it_IT, languages/da_DK/LC_MESSAGES/messages.mo, languages/da_DK/LC_MESSAGES, languages/da_DK, languages/fr_FR/LC_MESSAGES/messages.mo, languages/fr_FR/LC_MESSAGES, languages/fr_FR, languages/pl_PL/LC_MESSAGES/messages.mo, languages/pl_PL/LC_MESSAGES, languages/pl_PL, languages/de_DE/LC_MESSAGES/messages.mo, languages/de_DE/LC_MESSAGES, languages/de_DE, languages/ru_RU/LC_MESSAGES/messages.mo, languages/ru_RU/LC_MESSAGES, languages/ru_RU, languages/ja_JP/LC_MESSAGES/messages.mo, languages/ja_JP/LC_MESSAGES, languages/ja_JP, languages/fi_FI/LC_MESSAGES/messages.mo, languages/fi_FI/LC_MESSAGES, languages/fi_FI, languages/nl_NL/LC_MESSAGES/messages.mo, languages/nl_NL/LC_MESSAGES, languages/nl_NL, languages/tr_TR/LC_MESSAGES/messages.mo, languages/tr_TR/LC_MESSAGES, languages/tr_TR, languages/pt_BR/LC_MESSAGES/messages.mo, languages/pt_BR/LC_MESSAGES, languages/pt_BR, languages/sv_SE/LC_MESSAGES/messages.mo, languages/sv_SE/LC_MESSAGES, languages/sv_SE, languages/el_GR/LC_MESSAGES/messages.mo, languages/el_GR/LC_MESSAGES, languages/el_GR, languages/sl_SI/LC_MESSAGES/messages.mo, languages/sl_SI/LC_MESSAGES, languages/sl_SI, languages/it_IT/LC_MESSAGES/messages.mo, languages/it_IT/LC_MESSAGES, languages/it_IT, languages/da_DK/LC_MESSAGES/messages.mo, languages/da_DK/LC_MESSAGES, languages/da_DK, languages/fr_FR/LC_MESSAGES/messages.mo, languages/fr_FR/LC_MESSAGES, languages/fr_FR, languages/pl_PL/LC_MESSAGES/messages.mo, languages/pl_PL/LC_MESSAGES, languages/pl_PL, languages/de_DE/LC_MESSAGES/messages.mo, languages/de_DE/LC_MESSAGES, languages/de_DE

# concrete5 Cache Settings
Block Cache - On
Overrides Cache - On
Full Page Caching - On - If blocks on the particular page allow it.
Full Page Cache Lifetime - Every 6 hours (default setting).

# Server Software
Apache

# Server API
apache2handler

# PHP Version
5.5.9-1ubuntu4.11

# PHP Extensions
apache2handler, apc, apcu, bcmath, bz2, calendar, Core, ctype, curl, date, dba, dom, ereg, exif, fileinfo, filter, ftp, gd, geoip, gettext, gmp, hash, iconv, imagick, imap, intl, json, ldap, libxml, mapi, mbstring, mcrypt, mhash, mysql, mysqli, openssl, pcre, PDO, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, readline, Reflection, session, shmop, SimpleXML, soap, sockets, SPL, sqlite3, standard, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xml, xmlreader, xmlwriter, xsl, Zend OPcache, zip, zlib.

# PHP Settings
max_execution_time - 30
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 60
max_input_vars - 1000
memory_limit - 512M
post_max_size - 8M
sql.safe_mode - Off
upload_max_filesize - 2M
ldap.max_links - Unlimited
mysql.max_links - Unlimited
mysql.max_persistent - Unlimited
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
pgsql.max_links - Unlimited
pgsql.max_persistent - Unlimited
session.cache_limiter - <i>no value</i>
session.gc_maxlifetime - 1440
soap.wsdl_cache_limit - 5
opcache.max_accelerated_files - 2000
opcache.max_file_size - 0
opcache.max_wasted_percentage - 5

Browser User-Agent String

Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0