juser form plugin error

Status
Not open for further replies.

kinkaz

Member
Hey there,

I'm using the juser plugin, but when I submit the form, I'm getting this error :

Fatal error: Call to a member function get() on a non-object in C:\wamp\www\joomla\plugins\fabrik_form\juser\juser.php on line 109

How can I fix this ?

Thanks,
kinkaz
 
Yes, it's a little bug in this file.
It will be fixed in an upcoming GitHub release. In the meantime, you can fix it by adding
PHP:
$params = $this->getParams();
just before line 109, so the code should look like
PHP:
private function getFieldValue($pname, $data, $default = '')
{
    $params = $this->getParams();
    if ($params->get($pname) == '')
 
kinkaz - I am not sure how technical you are, but this is the sort of very simple bug that you might be able to diagnose yourself in the future. (Open Source software like this relies a lot on users contributing to the software quality, so if you can help that would be great.)

In this particular case, the error message points you to the file, the line in the file which is giving the error and a description of what the problem is. Here the error is says that we have code "$something->get(" where the $something is a non-object i.e. typically an uninitialised variable. So you look in the plugins\fabrik_form\juser\juser.php file on line 109 and see it says:
Code:
if ($params->get($pname) == '')
so it is $params that is uninitialised.

Then you look for similar code to see what it might be initialised to (look for "$params = " and in many places elsewhere in the same file (e.g. lines 88, 113, 127, 263 etc.) you find the same code:
Code:
$params = $this->getParams();
It is a pretty good guess that this is the code that is missing. So you copy and paste this line in immediately before line 109, save the file and see if it works.

If it works, then you are up and running again in the fastest possible time, and to get the same fix into the master version of Fabrik so that next time you update you don't have to add it again yourself, the simplest thing to do is to come to this forum and report the error in exactly the same way that you have but add your fix and someone will make sure that it is added to the master copy.

If it doesn't work, then you do what you already did, and report the error, adding what you already tried. Other users like myself or JF, or if needed Rob/Hugh, can then help you further - and my own experience is that people who try to contribute are more likely to get a quick response than those who just report bugs. And every time you try to fix it, you will take yourself a little further up the learning-curve and be more able to support yourself in the future.

I hope this helps.

S
 
Hi,

Both of you thanks for your answers. I didn't expect any quick answer and will correct myself the errors that I see and post them here in the future. Sorry about that.

kinkaz
 
Anything you can help fix is a bonus. If you can't work out how to fix it, just go ahead and ask here. :)

S
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top