On MODX 2.8.5 $modx->resource->getTVValue(‘webnews.NrItemPage’); return a value
On MODX 3.1.0 $modx->resource->getTVValue(‘webnews.NrItemPage’); return empty or null
Expected behavior
Tab with TV available
Environment
Apache 2.4.x / PHP 8.1.x
I tried it as admin member and sudoer, or as non-sudoer, same result.
I checked if settings is tvs_below_content is set to NO.
I checked on Manager customization : No form profiles are available
I checked the path of settings on config.inc.php
I can see the TV checked on the template available variables
Are there any related errors in the MODX error log? Or in the “Console” tab of the developer tools in the browser?
Did you try clearing the browser cache (and the MODX cache) after the upgrade? Maybe there is still some old file in the browser cache with the same name that gets executed instead of the updated code.
Does the database table modx_site_tmplvar_contentvalues still contain the TV values? Do the resources in the table modx_site_content have the correct value for “class_key” (e.g. MODX\Revolution\modDocument for a normal resource)?
This might not be of any help but I remember a similar problem with an older version of MODX where this would happen when an outdated tv type was used - something to do with list boxes from what I recall. I vaguely also remember having to go in and justsave each tv again after an upgrade.
Is this site using Form Customization to relable fields and position tabs? If so, is it possible you have stuff mapped to regions that may not exist any longer?
Hello thanks for your help @smashingred@chrisandy@halftrainedharry
I tested your proposals but it didn’t seem to be the same problem. Finally I restored a backup and reapplied the update to MODX 3.1 and it worked. Why did it work? I don’t know why. Probably a problem with the upgrade. Fingers crossed that it continues to work well
Thanks for your help, I’ve learned a lot.
@letamtam how did you do the upgrade? Did you do it manually on the server, using the Upgrade MODX Extra, Softaculous in cPanel, or in MODX Cloud using the Upgrade button?
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”.