Formz not working following update to MODX 2.7.1

Does anyone have the Formz extra running successfully with MODX 2.7.1?

I seem to have run into some issues with the MODX rendered not receiving an array where it was expecting one so I figured I’d start by asking: anyone seen this combo working in the wild?

I find questions like this tricky to answer - it’s basically asking for anecdotal evidence something works. I’m sure there’s someone somewhere that uses Formz on the latest version but how long do you want to wait for that specific person to find your post? :wink:

The better way to get an answer in my opinion is to explain what is not working for you, and finding out if there’s a fix for that. MODX 2.x has been pretty stable over the years in terms of keeping backwards compatibility for extras, so I’m inclined to say things are expected to work unless specifically stated otherwise. I don’t see any listed issues with 2.7.

Anecdotal evidence is exactly what I was after. I had looked at Github before posting. I saw no obviously related issues but I also saw no updates in 4 years and pull requests that have been outstanding for 5 years. My “has anyone seen this working” was a genuine attempt to ask the hive-mind for evidence to decide if this extra has now passed into effective abandonment.

But as you point out, that’s not much use to action if someone doesn’t happen to have direct experience with this combo and that was lazy on my part!

My issue is that following updates to 2.7.1, pages containing Formz TVs which are responsible for pulling in the Formz forms now show server 500 errors.

This is because the MODX parser is expecting an array in one of the arguments and isn’t getting one.
Uncaught TypeError: Argument 2 passed to modX::runSnippet() must be of the type array, null given, called in /www/core/components/formz/processors/mgr/tv/output/formz.class.php on line 15 and defined in /www/core/model/modx/modx.class.php:1853

This issue goes away when I change the output type of the TV from Formz to Text (i.e. when Formz isn’t getting called into a page and it just shows the form ID number).

My deduction so far is that either something has fallen apart in Formz or it’s just having a clash with something which has changed since 2.6.5.

I was about to start digging, but thought I’d test the waters to see if anyone has been here and not logged anything via github. If that’s not appropriate, I’m happy to have this topic nuked and I’ll post a solution if/when I find one. :+1:t2:

If anyone else runs into this issue, this fix from BobRay has sorted the issue for me:

It involves changing line 15 in core/components/formz/processors/mgr/tv/output/formz.class.php
return $this->modx->runSnippet('fmzForms', array_merge($mainOptions, $this->tv->_properties));
return $this->modx->runSnippet('fmzForms', array_merge($mainOptions, $this->tv->getProperties()));

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”.