CMS MADE SIMPLE FORGE

CMS Made Simple Core

 

[#12305] Removing actual Destination Page breaks Destination Page dropdown in Internal Page Link pages

avatar
Created By: Tristan (tristan)
Date Submitted: Mon May 04 09:25:43 -0400 2020

Assigned To: Ruud van der Velden (ruudvdvelden)
Version: 2.2.14
CMSMS Version: 2.2.14
Severity: Trivial
Resolution: Fixed
State: Closed
Summary:
Removing actual Destination Page breaks Destination Page dropdown in Internal Page Link pages
Detailed Description:
When you remove a content page used as target in an "Internal Page Link" type
page, the dropdown on that "Internal Page Link" type page can't be displayed
anymore leaving you with no other option than to set this to another page
directly from within the database. Would be nice if you couldn't delete these
destination pages just like you can't delete content pages with children.

Browser error: 
https://demo.prism.nl/admin/ajax_content.php?__c=3ad080470b7c981b196&t=1588598205105&disabled=false&create=&current=75&value=76&allowcurrent=true&use_perms=false&use_simple=false&allow_all=false&for_child=false&is_manager=1&secure_param=__c&user_key=3ad080470b7c981b196&admin_url=https%3A%2F%2Fdemo.prism.nl%2Fadmin&op=here_up&page=76
[Error] Failed to load resource: the server responded with a status of 500 ()
(ajax_content.php, line 0)


PHP error:
PHP Fatal error:  Uncaught Error: Call to a member function getChildren() on
null in
/home/prism/domains/prism.nl/public_html/demo/admin/ajax_content.php:92\nStack
trace:\n#0
/home/prism/domains/prism.nl/public_html/demo/admin/ajax_content.php(122):
{closure}(NULL)\n#1 {main}\n  thrown in
/home/prism/domains/prism.nl/public_html/demo/admin/ajax_content.php on line
92', referer: https://demo.prism.nl/


History

Comments
avatar
Date: 2020-05-04 10:26
Posted By: Ruud van der Velden (ruudvdvelden)

Possible fix but should be tested extensively.
lib\jquery\js\jquery.cmsms_hierselector.js

Starting a line 42:

	  $.ajax({
	      url: this.data.ajax_url+'&t='+$.now(),
	      data: { op: 'pageinfo', page: this.data.orig_val },
	      type: 'GET',
          }).pipe(function(result,textStatus,xhr){
	      if( xhr.status != 200 ) return $.Deferred().reject(result);
		  if( typeof result.status == 'undefined' || result.status != 'success' ) {
			self.data.hidden_e.val(-1).change();  
		  	return $.Deferred().reject(result);
		  }
	      return result.data;
	  }).done(function(data){
      
avatar
Date: 2020-07-23 22:28
Posted By: Matt Hornsby (DIGI3) (DIGI3)

Just in case anyone else runs into this and doesn't want to mess with the
database - you can use your page inspector (console) to show the hidden input
field and change or delete the page id then hit submit.
      
avatar
Date: 2020-09-07 17:38
Posted By: Ruud van der Velden (ruudvdvelden)

In theory the creator of the internal page link can be somebody not having
permissions to edit the target page and vice versa. Disallowing removal of a
linked page could mean someone is blocking the removal of a page which is out of
his control.

- The JS fix would solve the problem of the broken dropdown (probably a good
idea anyway)
- Maybe we should allow the deletion/disabling of a linked page, but then also
disable the linking 'internal page link' object.


      
avatar
Date: 2020-09-18 10:26
Posted By: Ruud van der Velden (ruudvdvelden)

fixed in svn 
      
avatar
Date: 2020-11-03 14:31
Posted By: Rolf (rolf1)

CMSMS 2.2.15 has been released
      
Updates

Updated: 2020-11-03 14:31
state: Open => Closed

Updated: 2020-09-18 10:26
resolution_id: => 7
assigned_to_id: 100 => 18365