Show in tree option disables itselfe on save after upgrade to 3.0.1


we’ve upgraded our page to 3.01 after a successful update of the test system.
We deleted the cache and updated all extras.

Every time a page/document is updated, it disappears in the tree view because the option “show_in_tree” disables itself.
See following gif:

Installed extras

I read about problems with the extra “Collections” which we aren’t using. The following extras are installed and up-to-date. CKeditor is disabled because of some console errors.
|Ace |1.9.3-pl|2022-05-30, 5:21 pm|
|Breadcrumbs|1.1.0-pl|2016-11-15, 7:04 pm|
|CKEditor|1.4.1-pl|not installed|
|FileUpload|1.2.0-pl|2020-03-06, 3:28 pm|
|FormIt|4.2.7-pl|2022-05-30, 5:22 pm|
|getPage|1.2.5-pl|2022-05-30, 6:00 pm|
|getResources|1.7.0-pl|2021-05-04, 3:09 pm|
|MIGX|3.0.0-alpha5|2022-05-30, 5:22 pm|
|ReCaptchaV2|3.2.2-pl|2021-05-04, 3:09 pm|
|SEO Pro|1.3.1-pl|2021-05-04, 3:10 pm|
|simpleUpdater|2.2.1-rc2|2021-05-04, 3:10 pm|
|SEO Tab|2.2.0-pl|2019-08-14, 9:55 am|
|VersionX|2.3.2-pl|2021-05-04, 3:09 pm|
|Wayfinder|2.3.3-pl|2016-11-15, 7:05 pm|

Observed behavior

A new created site inside of a container appears in the tree. After updating content of the site the site disappears.

Are there any plugins that run on the events OnDocFormSave or OnBeforeDocFormSave?
Does the behaviour change, if you (temporarily) deactivate these plugins?

Hey there,
thanks for your reply. I uninstalled all extras and cleared the cache. Same issue…

I also moved the pages to another tree element, by the properties and by d&d (works only if new created, because after the first update it disappears from the tree).

Maybe this log gives some infos?!

[2022-05-31 07:53:14] (ERROR @ /websites/htdocs/website_modx/core/vendor/xpdo/xpdo/src/xPDO/xPDO.php : 1267) Problem getting service fileHandler, instance of class modFileHandler, from path

Ok, I figured something out… strange behavior. If I delete the site it is shown in the tree. I can update and change everything in the site, as long it has the deleted status. If I undelete it, the site stays in the tree until I make a change to the site, while it’s not deleted…


This is very weird.

Can you somehow reproduce the same issue on a fresh MODX installation?

When you open the “Network” tab of the browser’s developer tools, can you check whether the sent value for the parameter show_in_tree is correct?
Is the value in the database table (column show_in_tree in table modx_site_content) correct?

1 Like

Ahhhhhhhhhhhhhh I’m such a fool…

When Modx 2.x came with the wastebin, it was so anoying for me to see the deleted pages in the treeview. I wrote a plugin wich hides deleted elements automatically.

$currentResource = $modx->event->params['resource'];
if ($modx->event->name == 'OnResourceDelete') {
    $result = $currentResource->set('show_in_tree',0);
} elseif($modx->event->name == 'OnResourceUndelete') {
    $result = $currentResource->set('show_in_tree',1);

In the current version Modx handles that hiding on its own and my script reverses the behavior. :slight_smile:

Thanks for helping me.

1 Like

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.