CMS MADE SIMPLE FORGE

CMS Made Simple Core

 

[#12272] Internal page link - selecting destination page problem

avatar
Created By: Christine Collen (ccollen)
Date Submitted: Sun Mar 15 08:38:04 -0400 2020

Assigned To:
Version: 2.2.13
CMSMS Version: 2.2.13
Severity: Trivial
Resolution: Fixed
State: Closed
Summary:
Internal page link - selecting destination page problem
Detailed Description:
I posted to the CMSMS support forum / CMSMS Core regarding setting up internal
page links for removed pages, using an article on the CMS Can Be Simple site.
The responses from Digi3 and Veldon suggest I raise a bug report.

On setting up a new content which is an Internal Page Link type, if the
destination parent is a Section Header, the child pages in the adjacent dropdown
defaults to the first page - there is no "None" option available in list. But
that value is not assigned as the link when you first set up the internal page
link. So it thinks you want to link to the section header which of course does
not have anything to display hence the Page Not Found being displayed instead.

To get around this, when you first set up an Internal Page Link to a sub-page of
a Section Header, you have to select another page in the child page list, apply,
then select the one you want which happens to be the first one in my particular
situation.

Now that I know this is what is happening, it is easy to work around it, hence
the trivial severity.


History

Comments
avatar
Date: 2020-03-15 09:02
Posted By: Ruud van der Velden (ruudvdvelden)

\lib\jquery\js\jquery.cmsms_hierselector.js

Starting at line 113:

if( parent_selectable ) {
  var opt = $('<option>'+cms_lang('none')+'</option>').attr('value',-1);
  sel.append(opt);
}
for( var i = 0; i < data.length; i++ ) {
var opt =
$('<option>'+data[i].display+'</option>').attr('value',data[i].content_id);
  //if( data[i].content_id == current ) opt.addclass('current');
if (!parent_selectable && selected_id == -1 && i == 0)
opt.attr('selected','selected').addClass('selected'); //we need to set the first
option selected for new dropdowns without option 'none'
if( data[i].content_id == selected_id )
opt.attr('selected','selected').addClass('selected');
  if( data[i].content_id == hilite ) opt.addClass('hilite');
if( data[i].content_id == this.options.value && !this.options.allowcurrent )
opt.attr('disabled','disabled');

Note the extra line starting with 
if (!parent_selectable && selected_id == -1 && i == 0) ...

That could be a work-around for now.
      
avatar
Date: 2020-03-19 06:09
Posted By: Rolf (rolf1)

Fixed in SVN for 2.2.14
      
avatar
Date: 2020-03-30 13:13
Posted By: Rolf (rolf1)

CMS Made Simple 2.2.14 is released
      
Updates

Updated: 2020-03-30 13:13
state: Open => Closed

Updated: 2020-03-19 06:09
resolution_id: => 7