Facing error in running my extension in Joomla 4

For Joomla! 4.x Coding related discussions, you could also use: http://groups.google.com/group/joomla-dev-general

Moderators: ooffick, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
snitish576
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Tue Mar 05, 2024 10:49 am

Facing error in running my extension in Joomla 4

Post by snitish576 » Tue Mar 05, 2024 11:01 am

Hello Team,

I have a requirement to run three extensions in my Joomla 4 project. Out of these three extensions two are working fine but whenever I enable the third extension, it gives my the error 'Call to a member function getWebAssetManager() on null'.
All these three extensions are working fine in Joomla 3.

It seems like there is some conflict in the below line whenever I enable my extension:-

$wa = $this->getWebAssetManager();

This line of code is written in around 300+ files.

Any help would be appreciated
Thanks
Last edited by toivo on Tue Mar 05, 2024 11:52 am, edited 1 time in total.
Reason: mod note: moved from 5.x General Questions

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 31055
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Facing error in running my extension in Joomla 4

Post by Per Yngve Berg » Tue Mar 05, 2024 11:55 am

Mod. Note: Relocated the topic from J5 Forum to 4.x Coding.

robbiej
Joomla! Apprentice
Joomla! Apprentice
Posts: 48
Joined: Wed Apr 06, 2016 11:22 am

Re: Facing error in running my extension in Joomla 4

Post by robbiej » Fri Mar 08, 2024 8:26 am

It looks like $this is set to null. It could be the case that

- you're not inside a PHP class

- you're in a static function of a class

- you've set $this to null at some point

We'd need a bit more context to determine what the source of the problem is.


Post Reply

Return to “Joomla! 4.x Coding”