Forums

[SOLVED] Confirmation page error (licensed version)

Phil91 08 Jun, 2009
Hi Max and Bob,

After getting the licensed version of Chronoforms, I recreated the confirmation portion of the registration form (which I lost during the process since I didn't save it) and, unlike with the unlicensed version, submitting the confirmed data causes a php error in the confirmation.php module...And I'm not good enough with php to see where it comes from..Basically RunPlugin error speaking of a non-object property or so...

[EDITED] Just browsing the Q&A forum: SAME ERROR MSG AS THE one indicated by zero-one:

"Fatal error: Call to a member function runPlugin() on a non-object in /var/xxx/xxxxx/components/com_chronocontact/plugins/cf_confirmation_page.php on line 173"


Looks like I'm not alone in the world 😀

I emailed the details to Max, so if somebody could look at it I would appreciate it to finish up pushing this form live...

Thx and best regards

Philippe
GreyHead 08 Jun, 2009
Hi Philippe,

As I just posted in the other thread, I can't replicate this error so this is somethign of a shot in the dark fix.

Please try this- open cf_confirmation_page.php and at line 122 (currently blank) add this line
		$MyCustomCode =& CFCustomCode::getInstance($MyForm->formrow->id);
		$MyPlugins =& CFPlugins::getInstance($MyForm->formrow->id); // <-- add this line
		if(JRequest::getVar('task') != 'beforeshow'){

Bob
Phil91 08 Jun, 2009
Hi Bob,

At first I thought it worked...

If I test the form by clicking on the link it DOES work.
If I use the embedded {chronocontact}formname{/chronocontact} in the article page it CAUSES A SERVER ERROR 500 and the page is not displayed.

[LATER] Checked a bit more: if I disable the confirmation page, the link works perfectly again and the form submits all...If I reenable Confirmation, it does not anywmore...

Any hint please?

Philippe
GreyHead 08 Jun, 2009
Hi Philippe,

Seems like a different bug.

Please open components/com_chronocontact/libraries/chronoform.php and just after line 29 add one line
	function &getInstance($formname = ''){

	   global $mainframe; // <-- add this line
		static $instances;

Bob
Phil91 08 Jun, 2009
Bob,

No more server error, but not there yet: looks at the attached shot (after.jpg)...Looks like it completely looses track of the system, template, encoding etc...

BTW: is there any internal cache for CF? reverting back doesn't change the output...

Philippe
GreyHead 08 Jun, 2009
Hi Philippe,

Weird, I just see a normal page . . . :-(

And there's no internal cache (doesn't make sense with forms).

Bob
Phil91 08 Jun, 2009
Shouldn't I uninstall CF and recreate my form from scratch?
It did work nicely BEFORE I licensed it 😀
GreyHead 08 Jun, 2009
Hi Philippe,

Ah - looked at the actual page and there's an error message down the bottom

Fatal error: Call to undefined method CFChronoForm::addhash() in /var/www/cc2/components/com_chronocontact/chronocontact.html.php(149) : eval()'d code on line 3

I'll take a look later

Bob
GreyHead 08 Jun, 2009
Hi Philippe,

Sorry for my delay in posting that - I had a phone call and left it complete without hitting submit :-(

I've checked the addhash() error and it links into Max's licensing code. I'm not completely sure how that is supposed to work or why you are getting that message.

Does your com_chronocontact/libraries/chronoform.php file had an addhash() function at line 510 or thereabouts? If not, then the files have gone out of sync somewhere.

Bob
Phil91 08 Jun, 2009
No...I can't find a AddHash method anywhere in this file...
GreyHead 08 Jun, 2009
Hi Philippe,

I'd suggest that you re-install RC 5.1 over the exisiting installation and see if that does the trick.

Bob
Phil91 08 Jun, 2009
Well...I actually uninstalled the component, reinstalled it (no license so no CURL anymore...) retried and still the same...
Looks like the version which worked had much less parameters in Forms Manager..

- the direct link fires up the form
- using a menuitem to link to a Chronoform form or an article containing the plugin {chronocontact}formname{/chronocontact} causes a Server error 500....Of course I restarted from your pristine package with no hacks like you suggested earlier...

And yet, if I "unlink" the Confirmation page, it does work! This is what I did for now until we find what happens...

BTW: a nice would have: Saving the confirmation code with the form when doing a backup would not hurt 😀 ...Tired of retyping it each time I reload the component 😀

Thx

Phil
GreyHead 08 Jun, 2009
Hi Philippe,

Hmmm . . . I'm afraid that I think Max needs to look at this and work out what is happening. It seems that he has changed some fundamental things in the latest release that are having odd side-effects :-(

Bob

PS I don't understand why CURL is missing ? How is that linked to the license?

PPS The plugin code is all saved in a database table - as long as you don't do a full uninstall it will still be there. Otherwise you could backup and then restore the db tables - that should save the re-typing.
GreyHead 08 Jun, 2009
Hi Philippe,

JUst thinking about this - please check if you now have the addhash() function. If you do, then please try re-doing the two earlier hacks.

Bob
Phil91 08 Jun, 2009
Hi Bob,

We had a bit of a private discussion some days ago with Max when I was trying to get the license to work. Max told me that I needed CURL to be installed in order for the license to be recognized. Since this is a private "empty" server, I had to install CURL and php5-curl to make the license to be validated, which I finally got to work...

I'll look for an AddHash method and will keep you posted tomorrow, but I honestly bet that there's something going on with the confirmation page code...I am a programmer myself, but not much involved in php and even less with Joomla SDK..

Philippe
GreyHead 08 Jun, 2009
Hi Philippe,

OK - that makes sense of the CURL piece. I think that you are correct that there is something wrong with the plugin code - though it seems to work OK for me (like you I'm using an unlicensed version of ChronoForms on my test site so that isn't the core problem).

Bob
Phil91 09 Jun, 2009
Bob,
Checked this morning: there IS a function AddHash in \libraries\chronoform.php but no call to it in this file nor anywhere in the component...

Phil
Phil91 09 Jun, 2009
Nope...Doesn't work...As soon as I activate the confirmation plugin, I get a server error 500. If I disable it, the form displays OK...
Server config issue?
GreyHead 09 Jun, 2009
Hi Phil,

Hmmm don't know without digging further - could be the absence of CURL causes the crash :-(

It all seems to work OK here but I have CURL enabled in my PHP - can't think of any other significant difference.

Bob
Phil91 09 Jun, 2009
Hi Bob,

CORRECTION...It DOES WORK NOW!!!
I had only the first fix and this led to Server error 500...Adding the second fix makes it work now!!!

Cool stuff...

Reactivated the license and it seems to work perfectly...Will monitor this for a while but I guess this is finally over!

Indeed, thanks again Bob!!! I owe you a big one 😀

Phil
pat01 11 Jun, 2009

Please open components/com_chronocontact/libraries/chronoform.php and just after line 29 add one line

	function &getInstance($formname = ''){

	   global $mainframe; // <-- add this line
		static $instances;


This did help to make the error go away. Will this little hack be included in the files in download section of CF? I don't really like to alter core files myself, because the changes might get lost when doing an update...

Patrick
GreyHead 13 Jun, 2009
Hi pat01,

Yes, it will be fixed in the core - it's on Max's list for the next release.

Bob
This topic is locked and no more replies can be posted.