xfrocks / bdApi

[bd] Api add-on for XenForo
GNU General Public License v3.0
98 stars 52 forks source link

Parse error: syntax error, unexpected ')' in \library\bdApi\ControllerApi\Post.php on line 566 #128

Closed suj87 closed 4 years ago

suj87 commented 4 years ago

This file has an error, which is an extra comma at the end of line 565: $pageNavParams,

The fix is to remove the comma: $pageNavParams

You won't see this error unless you manually look at the response - the request doesn't show up in the api logs.

daohoangson commented 4 years ago

Ah, this looks like an overlook on my part. The trailing commas have been allowed since PHP 7.3 but will cause issue if you are running an earlier version. I'll have to recheck the whole repo to find other places that have this kind of bug.

What is your PHP version by the way?

suj87 commented 4 years ago

Ah, this looks like an overlook on my part. The trailing commas have been allowed since PHP 7.3 but will cause issue if you are running an earlier version. I'll have to recheck the whole repo to find other places that have this kind of bug.

What is your PHP version by the way?

Yes I figured this would be a PHP version issue as I was looking at the file and noticed more trailing commas. PHP version on my local dev machine is 5.4.12 (very old WAMP setup that needs updating).

daohoangson commented 4 years ago

This has been fixed in #129, I have also added extra measures in place to avoid similar issues in the future. Let me know if it works for you.

suj87 commented 4 years ago

This has been fixed in #129, I have also added extra measures in place to avoid similar issues in the future. Let me know if it works for you.

I just downloaded the new version from the XF website, unzipped (overwrote all files) and ran the xml file. Bug looks fixed, many thanks.

daohoangson commented 4 years ago

Awesome. I'm closing this now.