CMS MADE SIMPLE FORGE

CMS Made Simple Core

 

[#12337] GetContentBlockFieldInput $adding always false

avatar
Created By: Chris Taylor (chrisbt)
Date Submitted: Mon Jul 27 12:02:47 -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:
GetContentBlockFieldInput $adding always false
Detailed Description:
The $adding param is always false even when adding / copying a page.

It is fixed by CMSContentManager/action.admin_editcontent.php line 293, by
changing:
$contentarray = $content_obj->GetTabElements($currenttab, $content_obj->Id()
== 0 );
to:
$contentarray = $content_obj->GetTabElements($currenttab, $content_obj->Id()
== -1 );


However I did not look at all the code that this might impact to to be certain
that it's a quality fix. But following GetContentBlockFieldInput back up the
call stack lead me to CMSContentManager/action.admin_editcontent.php and that
seems to be the first time $adding was actually set.

I also noted that in the core changelog it seems to have been fixed 3 times...
VERSION 2.2 - CANADA
VERSION 2.1.6 - SPANISH WELLS
VERSION 2.1.5 - HIGH ROCK


History

Comments
avatar
Date: 2020-08-05 11:35
Posted By: Ruud van der Velden (ruudvdvelden)

related: core content blocks ignore the $adding parameter and use their own
check. Probably this should be used consistently.

Example:

lib\classes\contenttypes\Content.inc.php:499

if( $this->Id() < 1 && empty($value) ) {
            $value = trim($this->_get_param($blockInfo,'default'));
        }
      
avatar
Date: 2020-09-04 18:55
Posted By: Ruud van der Velden (ruudvdvelden)

Fixed in svn (2.2.15)
      
avatar
Date: 2020-11-03 14:20
Posted By: Rolf (rolf1)

CMSMS 2.2.15 has been released
      
Updates

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

Updated: 2020-09-04 18:55
resolution_id: => 7
assigned_to_id: 100 => 18365