Syntax errors in valid Wordpress code since last update

PHP Tools [?] extends Visual Studio with set of advanced features to work more efficiently with PHP code.

Syntax errors in valid Wordpress code since last update

Postby PatriceOngla » October 5th, 2016, 1:00 am

Hello,

I'm encountering a strange issue. Till the last update (1.20.9074) VS displays many syntax error only in WordPress Code (only theme or plugin that work perfectly).

For example, in this code :
Code: Select all
      if( $field['field_type'] == 'multi_select' )
      {
         $field['multiple'] = 1;
         $field['field_type'] = 'select';
         $field['name'] .= '[]';
      }
      elseif( $field['field_type'] == 'checkbox' )
      {
         $field['name'] .= '[]';
      }


I get : "Syntax error: unexpected token 'endif'.

I have around 20 errors like that. There are all related to if-else blocks (either for the "elseif" keyword, either for the "endif" keyword that is sometimes used) except one error related to the protected keyword in the statement :
Code: Select all
protected $remote = null;
.

PHP version configuration issue ?

Thank you for your help.
PatriceOngla
 
Posts: 27
Joined: September 1st, 2015, 5:10 pm

Re: Syntax errors in valid Wordpress code since last update

Postby Miloslav Beno » October 5th, 2016, 6:32 am

Hello!

Thank you for letting us know. Could you please send us the whole source file where this happens?

You can attach it here or if you'd prefer send it to our email info@devsense.com

Thank you so much,
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm

Re: Syntax errors in valid Wordpress code since last update

Postby PatriceOngla » October 5th, 2016, 8:18 am

Hi Miroslav,

Thanx for your quick answer. Here is one of the source files where those errors occurs (and a screen copy). Please note that if I rewrite the same condition statement, the error disappears. So there is probably nothing wrong with the source code itself. But here it is.

I probably messed up something somewhere but I really can't figure what.

Regards.
You do not have the required permissions to view the files attached to this post.
PatriceOngla
 
Posts: 27
Joined: September 1st, 2015, 5:10 pm

Re: Syntax errors in valid Wordpress code since last update

Postby Miloslav Beno » October 5th, 2016, 3:00 pm

Hello,

Thank you for providing us with detailed information. You can download a fixed version https://www.devsense.com/download

Let us know if it works for you!

Cheers,
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm

Re: Syntax errors in valid Wordpress code since last update

Postby PatriceOngla » October 6th, 2016, 10:58 am

Hi,

The version has fixed the issue for me. Thanx for having done so quick.

Just by curiosity, what kind of problem was it ?
PatriceOngla
 
Posts: 27
Joined: September 1st, 2015, 5:10 pm

Re: Syntax errors in valid Wordpress code since last update

Postby Miloslav Beno » October 6th, 2016, 12:19 pm

Hi,

Great!

The issue was that our new parser wasn't handling correctly a case when there was ? in the comment followed by unix format new line :-)

Now this cases is covered by test so it will never happen again.

Thanks again and have a great day,
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm

Re: Syntax errors in valid Wordpress code since last update

Postby PatriceOngla » October 6th, 2016, 5:17 pm

Perfect. And congratulations for your tool and its support !

Cheers.
PatriceOngla
 
Posts: 27
Joined: September 1st, 2015, 5:10 pm

Re: Syntax errors in valid Wordpress code since last update

Postby Miloslav Beno » October 7th, 2016, 1:10 pm

Thank you!

Have a great day,
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm


Return to PHP Tools

Who is online

Users browsing this forum: No registered users and 46 guests

cron

User Control Panel

Login

Who is online

In total there are 46 users online :: 0 registered, 0 hidden and 46 guests (based on users active over the past 5 minutes)
Most users ever online was 297 on March 29th, 2024, 7:06 am

Users browsing this forum: No registered users and 46 guests