CMS MADE SIMPLE FORGE

CMS Made Simple Core

 

[#8474] Cannot add new template if show sitedown is active.

avatar
Created By: stephen cooper (scooper)
Date Submitted: Wed Oct 03 10:53:29 -0400 2012

Assigned To: Tapio Löytty (Stikki)
Version: 1.11.2
CMSMS Version: 1.11.2
Severity: Minor
Resolution: Fixed
State: Closed
Summary:
Cannot add new template if show sitedown is active.
Detailed Description:
Discovered on a clean install on of 1.11.2 but confirmed on 1.11.1


In Global Settings - Site Down Settings check "Enable Site Down Message" and
leave "Exclude users logged in to the CMSMS admin console:" unchecked.

Go to Layout - Templates - Add new template. Add a Name and click submit. 

Error message appears 'No content blocks defined in template' and template is
not added.

Unchecking "Enable Site Down Message"  or checking "Exclude users logged in to
the CMSMS admin console:" will enable you to add a template with no problem.

Looking at admin/addtemplate.php at about line 126 we have:

		 $contentBlocks = CMS_Content_Block::get_content_blocks();
		    if( !is_array($contentBlocks) || count($contentBlocks) == 0 ) {
throw new CmsEditContentException('No content blocks defined in
template');
		    }

so I'm assuming get_content_blocks() isn't returning the correct values with
site down enabled.
I'll leave it to better minds than mine to decide what the best solution is.

There is another bug #8409 logged that looks to be related to this but was
different enough for me log this one separately.

s.



History

Comments
avatar
Date: 2012-10-03 10:55
Posted By: Robert Campbell (calguy1000)

assigned to Tapio
      
avatar
Date: 2012-10-25 09:16
Posted By: stephen cooper (scooper)

Tested fix against dump of SVN 25th October and is working fine for me. 

Thanks for your efforts. Marking bug closed.

s.

      
Updates

Updated: 2012-10-25 09:16
state: Open => Closed

Updated: 2012-10-24 12:14
resolution_id: 5 => 7

Updated: 2012-10-03 10:55
resolution_id: => 5
assigned_to_id: 100 => 11306