CMS MADE SIMPLE FORGE

CMS Made Simple Core

 

[#8936] [Content>>Pages] Non-active pages are not listed in the Parent dropdown list

avatar
Created By: Lapinos (lapinos03)
Date Submitted: Thu Feb 14 17:35:54 -0500 2013

Assigned To:
Version: 1,11,4
CMSMS Version: None
Severity: Minor
Resolution: Works For Me
State: Closed
Summary:
[Content>>Pages] Non-active pages are not listed in the Parent dropdown list
Detailed Description:
Non-active pages do not appear in the Parent dropdown list. That used to work in
version 1.10.3. Regression !!

We've been using non-active pages as parent to hide pages on development or
archived pages.

/Lapi


History

Comments
avatar
Date: 2013-02-21 11:04
Posted By: Robert Campbell (calguy1000)

works here... just tested
      
avatar
Date: 2013-02-28 05:12
Posted By: Kristof Torfs (kristof.torfs)

I have to confirm this bug, but an important detail is that it only occurs when
editing pages, adding new pages works fine. This is probably what Robert tested.
      
avatar
Date: 2013-02-28 06:04
Posted By: Kristof Torfs (kristof.torfs)

Did some more research, inactive pages do appear in the parent dropdown, what
doesn't appear are inactive section headers (only when editing, not when adding
content).
      
avatar
Date: 2013-03-16 12:13
Posted By: Lapinos (lapinos03)

Today I made a fresh install to check again that bug.
Download again :
http://s3.amazonaws.com/cmsms/downloads/10470/cmsmadesimple-1.11.4-full.tar.gz
No extra modules installed.

Still the bug persists, whenever adding new content or editing a page. I have
put 2 new inactive pages and they do NOT appear in the parent dropdown.
      
avatar
Date: 2013-03-16 12:37
Posted By: Robert Campbell (calguy1000)

I just looked at an older 1.11.4 install... and a 1.11.5 install.  

Created a new section header... marked it as inactive.... saved it.
Edit another page, look at parent dropdown ... The section header is there....
cancel

Add a new page, look at the parent dropdown ... the section header is there....
cancel.

so I don't see a problem.
      
avatar
Date: 2013-03-16 19:08
Posted By: Lapinos (lapinos03)

Why are you talking about "section header" ? I'm talking about "content" pages
(the default type).

You have an old 1.11.4 installed. But did you install the current officiel
release ?

I tried to debug it step by step.
I have discovered that when the Content panel is rendered (with the table of
pages), a cache $_content_cache in file class.cms_content_cache.php is filled
with some id / hash /etc.. for all the pages, including inactive ones. I put
some breakpoints in that file where $_content_cache is in concern.

When the "Add new content" panel is rendered, $_content_cache is empty and gets
filled again but inactive pages are missing (have actually NULL values returned
by class.cms_content_cache.php->get_content($identifier)).

In the call stack, when stopping at the breakpoints, I can see that the process
goes through the MenuManager. It seems that $_content_cache is initialized by
MenuManager. (Then it may becomes logical that inactive pages are 'ignored' -
not stored in cache). Further, when
class.contentoperations.inc.php.ContentOperations->CreateHierarchyDropdown() is
called, it looks into $_content_cache (in some steps deeper) where values for
inactive pages are returned as NULL again by
class.cms_content_cache.php->get_content($identifier)).

Why is MenuManager processing here ? It has normally nothing to do with the "add
content" admin panel…

So I had the idea the edit the template (NCleanBlue - the default one) and
remove all the menu tags. And now, guess what ? The inactive pages appear in the
parent dropdown !!!

So for me there is a logical bug regarding the call of MenuManager... Or
$_content_cache should be cleaned somewhere after MenuManager, and before
CreateHierarchyDropdown().
      
avatar
Date: 2013-03-16 19:42
Posted By: Lapinos (lapinos03)

As a temporary workaround, I put a line to clear the cache before the
CreateHierarchyDropdown() is called. I don't know whether it is the correct
place (should not be dangerous). Now inactive pages do appear the Parent
dropdown list.

File class.ContentBase.php, Function display_single_element($one,$adding)
			case 'parent':
				{
					$contentops = $gCms->GetContentOperations();
					/*PGU 2013-03-16*/$contentops->ClearCache();
$tmp = $contentops->CreateHierarchyDropdown($this->mId, $this->mParentId,
'parent_id', 0, 1, 0, 1,get_site_preference('listcontent_showtitle',true) );
					if( empty($tmp) && !check_permission(get_userid(),'Manage All Content') )
return array('','<input type="hidden" name="parent_id"
value="'.$this->mParentId.'" />');
if( !empty($tmp) ) return array('<label
for="parent_id">'.lang('parent').'</label>:',$tmp);
				}
				break;

      
avatar
Date: 2013-03-16 19:58
Posted By: Robert Campbell (calguy1000)

I have now tested this on a second 1.11.4 install, with no difficulties.
      
avatar
Date: 2013-03-16 21:13
Posted By: Lapinos (lapinos03)

Well, what can I say ?  As I mentioned earlier, I downloaded and installed the
latest release available on cmsmadesimple.org yesterday.
I installed it on my MAC. I did not change any settings in the Site admin panel.

So what's up ?

Below, my system info :

----------------------------------------------

Cms Version: [b]1.11.4[/b]

Installed Modules:

    CMSMailer: [b]5.2.1[/b]
    CMSPrinting: [b]1.0.3[/b]
    FileManager: [b]1.4.3[/b]
    MenuManager: [b]1.8.4[/b]
    MicroTiny: [b]1.2.5[/b]
    ModuleManager: [b]1.5.5[/b]
    News: [b]2.12.10[/b]
    Search: [b]1.7.7[/b]
    ThemeManager: [b]1.1.7[/b]


Config Information:

    php_memory_limit: [b][/b]
    process_whole_template: [b][/b]
    output_compression: [b][/b]
    max_upload_size: [b]10000000[/b]
    url_rewriting: [b]none[/b]
    page_extension: [b][/b]
    query_var: [b]page[/b]
    image_manipulation_prog: [b]GD[/b]
    auto_alias_content: [b]true[/b]
    locale: [b][/b]
    default_encoding: [b]utf-8[/b]
    admin_encoding: [b]utf-8[/b]
    set_names: [b]true[/b]


Php Information:

    phpversion: [b]5.3.20[/b]
    md5_function: [b]On[/b] (True)
    gd_version: [b]2[/b]
    tempnam_function: [b]On[/b] (True)
    magic_quotes_runtime: [b]Off[/b] (False)
    E_STRICT: [b]0[/b]
    E_DEPRECATED: [b]0[/b]
    memory_limit: [b]128M[/b]
    max_execution_time: [b]60[/b]
    output_buffering: [b]4096[/b]
    safe_mode: [b]Off[/b] (False)
    file_uploads: [b]On[/b] (True)
    post_max_size: [b]10M[/b]
    upload_max_filesize: [b]10M[/b]
    session_save_path: [b]/var/tmp[/b] (1777)
    session_use_cookies: [b]On[/b] (True)
    xml_function: [b]On[/b] (True)
    xmlreader_class: [b]On[/b] (True)


Server Information:

    Server Api: [b]apache2handler[/b]
    Server Db Type: [b]MySQL (mysqli)[/b]
    Server Db Version: [b]5.1.66[/b]
Server Db Grants: [b]Found a "GRANT ALL" statement that appears to be
suitable[/b]


----------------------------------------------

I just have installed it on a debian6 server. Exactly the same problem.

1. download from http://www.cmsmadesimple.org/downloads/
2. install (no problem)
3. In admin, go to Content >> Pages
4. Suppress all pages except first one (alias home)
5. Add New Content , content type: Content -> submit
6. uncheck 'active' for that page
7. Add New Content, dropdown Parent list : unactive page does not appear. ->
Cancel
8. check active
9. Add New Content, dropdown Parent list : all pages appear.

/Lapi
      
Updates

Updated: 2014-03-14 23:33
cmsms_version_id: 29887 => -1
state: Open => Closed

Updated: 2013-02-21 11:04
resolution_id: => 11