Problem upgrading FRED to version 3.0 in MODX 2.8.7

Summary

FRED stops working in MODX 2.8.7 after upgrading from version 1.3 to version 3.0.

Step to reproduce

Set up elements in FRED 1.3 in MODX 2.8.7, then upgrade FRED to 3.0.

Observed behavior

No previously created elements, blueprints, etc. are displayed in the FRED extra editing screens. Keep getting the error message that “mgr/mgr/themes/getlist” is missing.

Trying to edit a FRED page and the page doesn’t load, just the endless loading animation.


Are there any special steps to take when upgrading to FRED 3.0 in MODX 2.8.x?

[EDIT:] Don’t apply this change! Clear the browser cache instead.


Try commenting out this line in the code and check if this fixes things:

After reverting to Freed 1.3, and then upgrading again to 3.0, it now works without alteration. Weird.

The problem seems to be outdated JS files in the browser cache after the upgrade. A hard refresh or clearing the browser cache should fix the issue (without a reinstall).


In the old JS file the action parameter already contains the segment mgr/

In the new file (with the same name) mgr/ is missing (and then gets added in the Fred connector.php.

I don’t think this is the case. There seems to be something further at play.

I have been restoring dumps from a live site to my staging servers, and this seems to be happening on every attempt - and I have cache disabled for the site via a browser extension

This does resolve the previous issue, but I seem to a have a larger issue related to this update I have been able to replicate now on three fresh attempts at updating fred on a migrated from live-to-staging setup using processes that have always worked fine for years.

for some reason, this fred update NUKES my RTE Configs, and seems to be populating them with the contents of my Option Sets.:

Option Sets:

RTE Configs:

Also - all site Fred editing is broken - throwing the following javascript error in console:

Uncaught (in promise) TypeError: Class constructor Oi cannot be invoked without ‘new’

So when you open the developer tools in the browser and select the “Network” tab, then click the “Refresh” ( ↻ ) button under the grid in the Fred CMP, what is the action parameter in the AJAX request that gets generated?

Are you also using MODX 2.x or is this MODX 3?

Using Modx 2.8.7

mgr/elements/getlist

(this is after commenting out the line you suggested)

And before that line is commented (cache is disabled) :

mgr/elements/getlist

I’m sorry but the issue is really that your JS files are outdated.
The action “mgr/elements/getlist” isn’t part of the file assets/components/fred/mgr/js/home/widgets/elements.grid.js anymore. Check the file on the server.

So I tried loading the site in Edge. Which I never use, but I know uses a completely different cache, and I still get this :slight_smile:

So while I believe you… :slight_smile:

Something else is missing in this

Did you add the line $action = 'mgr/' . $action; back to the file assets/components/fred/connector.php (that I erroneously suggested to remove in my first reply of this thread)?

I did. This one is super frustrating. There’s a lot more going on here.

The front end editing not working - was partly related to just having “Collections” extra installed and those Fred events enabled on it… despite not editing anything inside a collection or near one. This post pointed me to disabling the events on collections - and I updated Collections for good measure too:

After doing that, the front end issue I mentioned above went away, but now on editing the front end, I amd getting a number of 500 server errors I never got before all this.

and this related error in the php log:
PHP Fatal error: Uncaught Error: Class “modRequest” not found in \modx-core\components\fred\src\Traits\Endpoint\Ajax\RenderElement.php:119

I am using 2.8.6 - I am getting same problems if I update it to 2.8.7

Keep in mind this is a migration of a LIVE site to a staging site - again I have done this dozens (hundreds?) of times over the years and have never encountered this kind of collapsing after ensuring all db variables and config files are updated properly.

I test extra updates and major changes in this fashion BEFORE updating the live site. There is NO WAY I am updating any of these extras until this gets figured out!

Also - the back end issues remain with the incorrect RTE configs looking like they contain the Option Sets data. I have verfied the database data is accurate of course so it’s not really populating the rte table with bad data

Maybe try contacting @matdave directly or creating an issue on Github.
Personally I don’t use Fred and I’m really not familiar with the code base.

As far as I can tell, Fred had two different versions for MODX 2.x and MODX 3 that got merged into 1 single version for both MODX branches. So this new version has massive changes for MODX 2 (and apparently still some bugs).


My guess would be that this is a issue with the namespace.
So try changing this line

to

private $requestClass = '\\modRequest'; // maybe only one \ necessary

and see if that helps.

Try changing this line

to this instead:

return \Fred\v2\Processors\ElementRTEConfigs\GetList::class;

Also make the change for all the files in the folder core/components/fred/processors/mgr/element_rte_configs, as they all seem to be wrong.