We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Parse Error in V182 | Forum

Earl
Earl May 2 '16
Hi....I just installed v 182 and I'm getting the following error message after doing a tet signup...."Parse error: syntax error, unexpected '[' in /home/easee1/public_html/ cccccccccccccc.com/test/ow_system_plugins/base/bol/email_verify_service.php on line 315" The following is line 315....  $result = ["isValid" => false, "type" => "", "message" => ""]; Any help would be greatly appreciated and thenks in advance.
dave Leader
dave May 2 '16

what is the line before that please?


alot of times that error means that the previous line was not closed properly or something else with it.

The Forum post is edited by dave May 2 '16
ross Team
ross May 2 '16
Earl please provide the whole error you see 
Earl
Earl May 16 '16
 That is the whole error message I get after filling out the signup form and after clicking on the signup button. The following is from line 315 of the email_verify_service.php.

  /**
     * @param string $code
     */
    public function verifyEmailCode( $code, $loginUser = true )
    {
Line 315 -    $result = ["isValid" => false, "type" => "", "message" => ""];

        /* @var BOL_EmailVerified */
        $emailVerifyData = $this->findByHash($code);
        if ( $emailVerifyData !== null )
        {
            $result["type"] = $emailVerifyData->type;
            switch ( $emailVerifyData->type )
            {
dave Leader
dave May 16 '16
Well it would have to be one of these as the correct version 


$result = array();


$result = '["isValid" => "false", "type" => "", "message" => ""]';   //added single quotes outside



$result = array("isValid" => "false",

                       "type" => "",

                       "message" => ""

                     );


$result['isValid'] = 'false';

$result['type'] = '';

$result['message'] = '';



any of those would work i would think.  I am not on my test site so i am not able to test right now. 





The Forum post is edited by dave May 16 '16
Earl
Earl May 16 '16
Thanks, this.....


$result['isValid'] = 'false';

$result['type'] = '';

$result['message'] = '';


...worked like a charm. Thanks again.

dave Leader
dave May 16 '16
Thanks for letting us know, i think i fixed my syntax errors in the other two, but if the third one worked thats great... 


Glad you got it sorted. 


ross Team
ross May 16 '16
Earl what is your php version? 
dave Leader
dave May 17 '16
Yes Earl this was not intended as a permenant fix, just a temp to get you going.  We certainly don't want everyone changing the core because then it will be overwritten by an update and it does not fix the real issue. We need to find a perm solution so please work with ross to get a to a more stable fix. 


Thanks :)

Earl
Earl May 17 '16

I am using the following:


Apache Version2.2.24

PHP Version5.3.29

MySQL Version5.1.73-cll

The Forum post is edited by Earl May 17 '16
dave Leader
dave May 17 '16
on the right side of this page you can see the requirements. 


https://developers.oxwall.com/hosting


Your PHP version does not meet the specs so that could be why you got that error. 


You really need to update your PHP version to at least 5.5  or run a previous version of Oxwall.  


If you need a previous version let me know i think i might have 1.7.5 somewhere or ill try to find a link for a download for you.   I have 1.8.1 also which was before that requirement and was released Jan 2016  Here is a link to the change logs.


 https://developers.oxwall.com/1.8.2/CHANGELOG.txt  


Just scroll down for the previous logs. 


Remember that we prefer for you to update your PHP and run the latest version so we can support you better. 


The Forum post is edited by dave May 17 '16
Earl
Earl May 17 '16
You were absolutely right! I upgraded to php 5.6 and upgraded oxwall to 1.83.....reverted back to the original script _   /**
     * @param string $code
     */
    public function verifyEmailCode( $code, $loginUser = true )
    {
Line 315 -    $result = ["isValid" => false, "type" => "", "message" => ""];

        /* @var BOL_EmailVerified */
        $emailVerifyData = $this->findByHash($code);
        if ( $emailVerifyData !== null )
        {
            $result["type"] = $emailVerifyData->type;
            switch ( $emailVerifyData->type )
            {....and things are working with the e mail verify as they should. Thanks again for the invaluable lesson.
dave Leader
dave May 17 '16
You are most welcome Earl, let us know if you need any help in the future.. :)


+1 ross for bringing it up :)

The Forum post is edited by dave May 17 '16
ross Team
ross May 17 '16
Great, thanks for letting us know.