Hi!
I have just had my eyes opened. I found this beautiful CMS framework and I love what you girls and boys have accomplished so far. Tanks for giving a 'not_so_much_of_a_codemonkey_guy' a chance to build nice web applications.

When trying to activate the Domain Access module I receive an error:
Parse error: syntax error, unexpected '=', expecting ')' in /hsphere/local/home/jaxpax/konsultblog.se/drupaltest/modules/domain/domain.module on line 1242

I have done this with two different installations, first with my first Drupal try-out and I thought that other modules had an impact. So therefore I installed a fresh Drupal site 6.3, with no other modules than the ones that comes with the package, but the error was still the same. I have to remove the domain-folder completely before the site becomes alright again.

Hope this info is enough for you?

Thanks!
/Patrik

Comments

agentrickard’s picture

Status: Active » Postponed (maintainer needs more info)

It is, but I cannot reproduce the error -- and others would have spotted that immediately, too.

Are you sure you installed the proper module version? Look at the top of the domain.module file. What is the string that starts:

// $Id: domain.module,v 

What version of PHP are you running?

jaxpax’s picture

Hi!
It says:
domain.module,v 1.59 2008/07/06 21:16:39

I see that my hosting company is using PHP version 4.4.7. I suppose that this version might be to old? Is there anything I can do to make it work with that version?

//Patrik

agentrickard’s picture

It should work on 4.4.7. Not sure why it wouldn't.

Try changing line 1242 to:

function domain_domainupdate($op, $domain = array(), &$form_state) {

Or

function domain_domainupdate($op, $domain = array(), $form_state = array()) {

And tell me if either one works without error.

jaxpax’s picture

Hi!
I have just tried both of them and they generated this error:
Parse error: syntax error, unexpected '=', expecting ')' in /hsphere/local/home/jaxpax/konsultblog.se/drupal/modules/domain/domain_content/domain_content.module on line 156

agentrickard’s picture

WTF?

agentrickard’s picture

Title: Parse error when activating domain access module » Cannot assign default value to variable passed by reference.
Assigned: Unassigned » agentrickard
Status: Postponed (maintainer needs more info) » Active

You need to make the same change there, plus:

- line 262 of Domain Nav
- line 187 of Domain Prefix
- line 184 of Domain Source
- line 282 of Domain User

But that is only a temporary fix. I have to change the API -- and stop passing that value by reference.

Which of the corrections did you use?

agentrickard’s picture

Category: support » bug
jaxpax’s picture

Title: Cannot assign default value to variable passed by reference. » Parse error when activating domain access module
Assigned: agentrickard » Unassigned
Category: bug » support
Status: Active » Postponed (maintainer needs more info)

Yea this is strange. And this module is a central part of my idea, on how to build my site, damn it ;-)

jaxpax’s picture

I used both of them and they both generated the same error.

agentrickard’s picture

Title: Parse error when activating domain access module » Cannot assign default value to variable passed by reference
Status: Postponed (maintainer needs more info) » Active

Please do not reset the title. It is for my use.

It should work fine if you make the corrections to the line above. It appears that PHP 4.4 does not like the syntax:

&$form_state = array()

Just go change it in the places I note, and I will roll a real patch after my house is rebuilt from the $#!@! trees that fell on it last week.

agentrickard’s picture

Understand that you are simply seeing the _same_ error. It might occur in 6 different places in the code.

I do not have time to babysit this issue.

jaxpax’s picture

Title: Cannot assign default value to variable passed by reference » Parse error when activating domain access module
Status: Active » Postponed (maintainer needs more info)

YEAAA :-)
You got it! awesome!
I used this: function domain_content_domainupdate($op, $domain = array(), &$form_state){
I also had to change domain_content and I've recieved no error, so far. I'm going to elaborate with this great module and hopefully don't have to come back to you again. Thanks a bunch for your help and for a fantastic module.

Best regards
Patrik

agentrickard’s picture

Title: Parse error when activating domain access module » Cannot assign default value to variable passed by reference.
Assigned: Unassigned » agentrickard
Category: support » bug
Status: Postponed (maintainer needs more info) » Patch (to be ported)

OK -- so that fixes it for you -- nice catch, by the way. In the next release, I'll fix the syntax so this doesn't happen.

For some reason, the issue keeps changing status and title. Let's leave it alone.

[note: this needs to be backported to D5 as well]

agentrickard’s picture

Status: Patch (to be ported) » Needs work

This actually applies only to D6.

Garrett Albright’s picture

StatusFileSize
new4.9 KB

Patch, code needs work? But where's the patch?

Oh, wait. Here it is.

grep found another &$form_state = array() hiding in API.php, so I took care of that one as well.

Curse my company's D-list hosting provider for not upgrading to PHP 5 yet… but I guess it was good in this case to help find that unusual piece of code.

(Note that I haven't really tested this patch yet aside from successfully enabling all of the Domain Access modules…)

agentrickard’s picture

Status: Needs work » Reviewed & tested by the community

Thanks for the patch. I had it marked, but had not rolled one yet.

agentrickard’s picture

Status: Reviewed & tested by the community » Patch (to be ported)
StatusFileSize
new6.4 KB

Here's the patch as committed, just in case you can't wait for the release. Will backport the API change to D5.

agentrickard’s picture

Status: Patch (to be ported) » Fixed

No update to the 5.x API needed.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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