When you first install version control API and eable it through the module page you will be prompted with the following error message:

Parse error: syntax error, unexpected '=', expecting ')' in /var/www/modules/versioncontrol/versioncontrol.module on line 800

This will remain no matter which page you visit on your site until the problem is fixed. That line in the code is:

function versioncontrol_get_commits($constraints = array(), &$result_count = NULL, $page = NULL, $limit = 10) {

Comments

jpetso’s picture

Status: Active » Closed (fixed)

I see nothing wrong with this line... in fact, it looks the same on my system and there it works flawlessly. Also, the error message doesn't make *any* sense for this line. I'm sorry to close this bug as invalid, but there must be some error on your system. (On an unrelated note, you should also not be installing contributed modules in modules/ but rather in the sites/all/modules/ directory... but that is probably not the cause of your error.)

jpetso’s picture

As most possible cause for this I would probably suspect a PHP version from the stone age or earlier that did not support default values yet. However even PHP 4.4.x (and probably much earlier) can do this, so I'd really be surprised if a PHP version still exists that can't do default values.

jpetso’s picture

Status: Closed (fixed) » Active

Hm... reading up on the PHP manual, it seems that default values by reference (as used in this function) are only supported in PHP 5 or later. So, sorry about the claim above, it's obviously incorrect then as you can't even do that in the latest PHP 4.

So for fixing this bug, I've got two choices:
1) Redesign the API so that this parameter doesn't take any default value (painful, as it's not supposed to be used under normal circumstances), or
2) Document this in the README.txt and on the project page, and state that Version Control API doesn't run on PHP 4.

To be honest, I really prefer option 2, as a) PHP 4 won't be supported anymore after 2007 (which is in three weeks already) and b) Version Control API is a new module, so it doesn't break for users where it worked before.

Please upgrade to PHP 5, you should be doing that anyways from a security point of view in the next couple of weeks. Sorry for being an asshole, but there *are* good reasons for not accomodating this for PHP 4.

Leaving the issue open until the documentation work has been done.

hunmonk’s picture

Title: Version Control API Bug Causes Site Disabling Error » Document Version Control API not compatible with PHP < 5
Assigned: Unassigned » hunmonk
Category: bug » task
Priority: Critical » Normal

added a CAVEATS section to the README.txt to inform the user that the module doesn't work with PHP < 5.

leaving this open for now, because when we port to 6.x, we'll want to remove the documentation from the README and add the PHP compatibility parameter to the .info file.

jpetso’s picture

Component: Code » API module
Status: Active » Fixed

HEAD (which will become 6.x-1.x) has the PHP requirement moved from README.txt to versioncontrol.info, thus, fixed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

  • Commit 877df9e on 5.x-1.x, 5.x-2.x, 6.x-1.x, repository-families, drush-vc-sync-unlock by hunmonk:
    #200270 by hunmonk: Document Version Control API not compatible with PHP...
  • Commit b7668bc on 6.x-1.x, repository-families, drush-vc-sync-unlock by jpetso:
    D6 upgrade item #24: New syntax for .info files. Also fix #200270 by...

  • Commit 877df9e on 5.x-1.x, 5.x-2.x, 6.x-1.x, repository-families by hunmonk:
    #200270 by hunmonk: Document Version Control API not compatible with PHP...
  • Commit b7668bc on 6.x-1.x, repository-families by jpetso:
    D6 upgrade item #24: New syntax for .info files. Also fix #200270 by...