Uploaded image for project: 'In-Portal CMS'
  1. In-Portal CMS
  2. INP-1230

Don't create "_Auto: " page, when it's accessed in "Content Mode"

    XMLWordPrintable

    Details

    • Type: Bug Report
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.2.1-B2
    • Component/s: CMS
    • Labels:
      None
    • Change Log Group:
      Changed
    • Change Log Message:
      The "_Auto: " page now isn't automatically created, when page is accessed in "Content Mode".
    • Story Points:
      2
    • Copy Issue Key:
    • Patch Instructions:

      Patches must be submitted through Phabricator.

      Description

      By default for every template (*.tpl file) in theme a corresponding section (category) is created. This is done to:

      • allow presence of content blocks (pieces of HTML, that can be edited via WYSIWYG editor) on that template
      • allow setting custom properties of that template (e.g. cache lifetime, secure http connection requirement, etc.)

      If during development time decision is made, that a particular template don't need that, then filename must be added to ".smsignore" file, that is located in same directory, where template file is created.

      However I've found a behavior, that In-Portal still creates a page (ignoring .smsignore file), when user visits it in any of editing modes (browse/content/design). This code in question in "categories_event_handler.php" file (line 637):

      if ($page_id === false && EDITING_MODE) {
      	// create missing pages, when in editing mode
      	$object = $this->Application->recallObject($this->Prefix . '.rebuild', null, Array('skip_autoload' => true));
      	/* @var $object CategoriesItem */
      	$created = $this->_prepareAutoPage($object, $template, null, SMS_MODE_AUTO); // create virtual (not system!) page
      	if ($created) {
      		if ($this->Application->ConfigValue('QuickCategoryPermissionRebuild') || !$this->Application->isAdmin) {
      			$updater = $this->Application->makeClass('kPermCacheUpdater');
      			/* @var $updater kPermCacheUpdater */
      			$updater->OneStepRun();
      		}
      		$this->_resetMenuCache();
      		$this->Application->RemoveVar('PermCache_UpdateRequired');
      		$page_id = $object->GetID();
      		$this->Application->SetVar('m_cat_id', $page_id);
      	}
      }

      Removing code, mentioned above solved mentioned problem, but created another one. Tag <inp2:st_EditingScripts/> produced SQL error, because it always assumes, that section (category) must exist prior to calling this tag.

      As a solution we should not show any editing control (e.g. content revision toolbar) on a template if it doesn't have corresponding section (category).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alex Alex
                Reporter:
                alex Alex
                Developer:
                Alex
                Reviewer:
                Dmitry Andrejev [Intechnic]
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: