Joomla 4: Call to undefined method Joomla\CMS\Installer\Adapter\ComponentAdapter::get()

931 views
Skip to first unread message

ChrisG

unread,
Nov 22, 2017, 11:47:46 AM11/22/17
to Joomla! General Development
This error occurs when calling $parent->get('manifest')->version; in the postflight method of a component InstallerScript.

I'm guessing that a lot of people need to get the version string from the manifest, and I guess that $parent->get('manifest')->version; is no longer the right way to do it.

Does anyone know how to get the manifest version in Joomla 4 please?

Michael Babker

unread,
Nov 22, 2017, 12:35:34 PM11/22/17
to joomla-de...@googlegroups.com
The extension adapters no longer extend JObject so yes, get() won't work anymore.  IIRC getManifest exists for this one, but it's been a bit since I touched or looked at that code so I may be misremembering.

--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-general+unsub...@googlegroups.com.
To post to this group, send email to joomla-dev-general@googlegroups.com.
Visit this group at https://groups.google.com/group/joomla-dev-general.
For more options, visit https://groups.google.com/d/optout.

ChrisG

unread,
Nov 22, 2017, 1:27:30 PM11/22/17
to Joomla! General Development
$parent->getManifest()->version;

Works great. You saved me a lot of time.

Thank you very much.

Reply all
Reply to author
Forward
0 new messages