Call to undefined function helpAsset() while trying to configure jsconnect
Hello Everyone,
I'm new to Vanilla forums software and I wanted to give it a try so I downloaded the latest 2.3.1 version and got it up and running. No issues. I also uploaded a theme and that worked like a charm.
I then proceeded to install jsconnect. Seamless transition between my app and forums is important. I ran into multiple issue.
First I got a "PHP Fatal error: " red bar in the plugin section when I try to enable the plugin. No error message on the UI. Network shows HTTP 500. I looked into the logs and saw this.
PHP Parse error: syntax error, unexpected '*', expecting ',' or ';' in /home/admin/vanilla-core-2-3-1/plugins/jsconnect/class.jsconnect.plugin.php on line 29
That line is const NONCE_EXPIRATION = 5 * 60;
which really doesn't make sense. As the same code works on a windows environment PHP 7. I'm on Ubuntu 14.04 PHP above 5.6 in production though. So I changed that to const NONCE_EXPIRATION = 300;
I was able to enable the plugin.
When I try to go to the settings I see this exception in the logs. In the UI I see a white page. But in the logs I see -
Call to undefined function helpAsset() in /home/admin/vanilla-core-2-3-1/plugins/jsconnect/views/settings.php on line 8,
I'm not very familiar with the framework but it seems like the plugin code above assumes the helpAsset() would be available during run time in some vanilla core libraries so it makse that call? Prior version would simply use echo to print those text out.
Anyone else running into this issue and know of a workaround? I can also post the full debug log for windows tomorrow for some reason setting $Configuration['Debug'] = TRUE;
on vanilla-core-2-3-1/conf/config.php does nothing.
Thanks!
Comments
The jsConnect plugin has been updated a few days ago. The helpAsset function has been introduced in Vanilla 2.4 and so obviously the uploaded jsConnect version is incompatible with Vanilla 2.3
So please try downloading the "old" 1.5.3 version.
Thanks for getting back to me. I've tried the old 1.5.3 version with Vanilla 2.3.1 and I'm able to get to the jsconnect settings page and configure it but I ran into more issues while trying to use the php library mentioned in the sso section of the doc. http://docs.vanillaforums.com/help/sso/jsconnect/overview/ and https://github.com/vanilla/jsConnectPHP Clicking signin button on the forums directed me to my app and after I logged in, the authentication url in my app gave this message.
({"error":"invalid_request","message":"Missing the v parameter."})
The library is looking for "v" querystring parameter but the plugin doesn't generate. Similarly other parameters like "signature" which is what the jsconnect 1.5.3 plugin generates has been updated to use "sig".
I just thought using the latest jsconnect would have all the these resolved to work with the latest vanilla forums. Guess I'm wrong hah. Anyway I'll try to tweak the php libarary for authentication and see if i can get it to work.
After forcing "v" parameters to 2 in the library (I don't know what side effect this has if any) and renaming "sig" to "signature" I'm now getting blocked with "nonce" querystring param which seems to be used to generate a hash in the PHP Library but plugin doesn't generate that. Looking for workaround/fix here. Will post if I find something.
Does anyone know which Vanilla + jsconnect version combination work without a hitch with the existing PHP library (https://github.com/vanilla/jsConnectPHP)? I don't care how old it is as long as it works.
After a bunch of trial and error trying different combinations of vanilla forums versions/jsconnect versions/php library here is the combo that seems to work. Hope this saves someone else few hours!
Vanilla 2.3.1
jsconnect 1.5.3
php library : https://github.com/vanilla/jsConnectPHP/tree/revert/revert-to-1dot3
Although it fixes most of the issues and gets you to the point where it says "Sign in with" and after that nothing happens. You click it and sso executes without logging in. Anything I'm missing?
I resolved the issue by defining roles.
For some reason jsConnect doesn't assign default 'guest,user' roles to the new registrations and assigns a role id of '8' in database. There is no error handling for "Permission is denied" in jsConnect class (I've not looked into the files but I had to assume it because no error is shown if the user is not permitted)
Um.. Okay, I just DL'ed the latest jsconnect, went through the same thing these people went through. I just can't believe the lack of attention to the opensource community. No 'requirements' listed.. no readme instruction.. and the latest jsconnect is not compatible with the current stable build of vanilla. Is anyone running this ship?
I have a working set of files for 2.3.1 if anyone needs them... not sure what versions exactly.
No, but volunteers are welcome
There is indeed a lack of participation from the open source community. There are only a handful of plugin authors and even less people making pull requests for Vanillas source. There is no one here around who has the will or the skill to push the OS version forward.
Vanilla Inc. has to run their business and that includes that they cannot spent the time they would like to and that it might need to, donating to the OS community.
As you might see from the linked discussion, that is a problem which is known and if there would be someone who has the will to engage himself, he would get support.
I have did this step for step and I can login to my site with no problem, I click on forums and it dont show the sso login link so i have to login using entry and then when i login using entry i go to test jsconnect it has all the information but its not using it however when i click logout it does logout acroos the board. any ideas? I seen some where in here about roles but not sure what to do.
I dont even get the sso link :-( how di you add a default role
@Gotcha are you using the 'Vanilla jsConnect Auto SignIn' plugin?