akeeba / fof

Rapid Application Development framework for Joomla!™ 3 and 4
0 stars 0 forks source link

Form/Field/Numeric - Call to a member function getModel() on null #669

Closed anibalsanchez closed 5 years ago

anibalsanchez commented 6 years ago

Hi,

If the field constructor doesn't receive a form and the form is null, then this error is generated.

Call to a member function getModel() on null

Regards, Anibal

nikosdion commented 6 years ago

Why would you initialize a form field against a form without a Model? There is an implicit assumption that there's always a model attached to the form. Otherwise the form is useless.

Yes, I know that Joomla! does that shit but that doesn't make it any less stupid. In the end of the day, building an XML file which is parsed by a thick layer of intertwined technologies to loop through opaque objects which render an HTML fragment each is disingenuous and dates back to when JLayout did not exist. I thought we were past the Dark Ages ;)

Also, XML forms are marked for removal in FOF 4.0 - which will basically be FOF 3 minus forms since that feature won't fly with Joomla! 4, the major version being bumped only because of semver.

anibalsanchez commented 6 years ago

Hi,

I found this error in a form that had the "Numeric" type in the Xml configuration. Nothing complicated in this particular extension.

After digging for a while, I found the right error message and I solved the error changing the type to "Number".