Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions core/model/schema/modx.action.fields.schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
<tab name="modx-resource-content">
<field name="modx-resource-content" />
</tab>
<tab name="modx-resource-content-above" />
<tab name="modx-resource-content-below" />
<tab name="modx-resource-main-right">
</tab>
<tab name="modx-resource-main-right-top">
Expand Down
15 changes: 13 additions & 2 deletions core/src/Revolution/modActionDom.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,21 @@ public function apply($objId = '')
$ruleType = $this->get('rule');

$container = json_encode($this->get('container'));
$itemId = json_encode($this->get('name'));
$itemId = $this->get('name');
$value = $this->get('value');

/** Backward compat: Support for legacy tab ids for above/below content regions */
foreach (['itemId', 'value'] as $identifier) {
$$identifier = in_array($$identifier, ['modx-content-above', 'modx-content-below'])
? str_replace('modx-', 'modx-resource-', $$identifier)
: $$identifier
;
}

$itemId = json_encode($itemId);
$value = in_array($ruleType, $boolRules)
? (int)$this->get('value')
: json_encode(htmlspecialchars($this->get('value'), ENT_COMPAT, $encoding))
: json_encode(htmlspecialchars($value, ENT_COMPAT, $encoding))
;

switch ($ruleType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1045,8 +1045,10 @@ Ext.extend(MODx.panel.Resource,MODx.FormPanel,{
,autoHeight: true
,hideMode: 'offsets'
,items: [{
id: 'modx-resource-content-above'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change, I'm not sure if big enough, but can break some extras that are injecting to those places and using the ID for identifying the space. (same goes for the modx-content-below)

Copy link
Collaborator Author

@smg6511 smg6511 Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It shouldn't be: There's BC support added in modActionDom that transforms the old id to the new one as the rules are actually being built. Is there a scenario I'm not thinking of that would be problematic?

Although I suppose I'm thinking of this specifically in the context of Form Customization; guessing you're thinking one might have reason to directly access these two components outside of the FC process?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@theboxer - Ok, to cover your concern I went ahead and added back in two items using the original ids with a deprecation notice.

},{
/** @deprecated To be removed in 3.3, reference new region id 'modx-resource-content-above' */
id: 'modx-content-above'
,border: false
},{
xtype: 'textarea'
,name: 'ta'
Expand All @@ -1057,8 +1059,10 @@ Ext.extend(MODx.panel.Resource,MODx.FormPanel,{
,grow: false
,value: (config.record.content || config.record.ta) || ''
},{
/** @deprecated To be removed in 3.3, reference new region id 'modx-resource-content-below' */
id: 'modx-content-below'
,border: false
},{
id: 'modx-resource-content-below'
}]
};
}
Expand Down
Loading