Parse error

toma - July 4, 2007 - 10:00
Project:CCK Taxonomy Super Select Ultra
Version:5.x-0.9
Component:Code
Category:bug report
Priority:critical
Assigned:rconstantine
Status:closed
Description

Hi thanks for this module, i try to my live site but i just get a blank page, the home page and everything gone, to get back my site to work, i delete the cck_taxonomy_ssu directory

I am using
Drupal 5.1
Mysql 4.0.24_Debian
PHP 4.3.10-21
Apache/1.3.33

#1

rconstantine - July 4, 2007 - 17:10
Assigned to:toma» rconstantine

??? You mean, after installing this your site was unusable? That's very strange. Several people have used this without issues. Please confirm that you have the issue after activating the module. If the problem is before module activation, try deleting the install file as you won't be needing it. In fact, I made this as an intended replacement for the current cck_taxonomy module, but the author didn't want to take his module in that direction. So technically, I should delete the install file as it isn't needed at this point.

One other thing I noticed was that I failed to include the taxonomy module as a requirement in the info file, so if you don't have the taxonomy module enabled, you'll have problems. I don't think I forgot any other dependencies.

Let me know about the things above, and I'll try to think of what else could be giving you this issue.

#2

rconstantine - July 4, 2007 - 17:10

Wait a minute. Are you also using this on a test site that works fine?

#3

toma - July 4, 2007 - 23:36

I try to use on a live site, i disable taxonomy superselect and cck taxonomy, i active your module, and i get a blank page on the confirm page, also i get a blank page on all my web site until i delete the module directory !

#4

rconstantine - July 5, 2007 - 19:15

okay, try deleting the install file before you activate it. I don't think it's needed in your case.

#5

Eep² - July 8, 2007 - 20:39

I get "Parse error: syntax error, unexpected '=', expecting ')' in ../drupal/modules/cck_taxonomy_ssu/cck_taxonomy_ssu.module on line 948" when I try enabling this module, then I can't even load any other page and this error is given constantly. :/

#6

rconstantine - July 9, 2007 - 16:43

Thanks for something specific to look for. I'll check it out now.

#7

rconstantine - July 9, 2007 - 16:49

So the line you mentioned has nothing around it that would be wrong. I wonder if the uploaded files simply got corrupted. I'll check that next, then expand my search in the code around that line number.

#8

rconstantine - July 9, 2007 - 17:23

I'm really stumped on this one. I've uninstalled, deleted, and reinstalled on my machine and can't duplicate the problem. I wonder if I forgot another dependency. For now, if you could try the new files I uploaded to CVS here: http://cvs.drupal.org/viewcvs/drupal/contributions/modules/cck_taxonomy_... I'd appreciate it. Only the info and module files are different. But the code didn't really change, so you may have the same problem.

I'm using the PDT for Eclipse as my editor and it does a good job of identifying problems in syntax as was mentioned in #5 and it's not showing me any problems there.

#9

rconstantine - July 9, 2007 - 17:27

Okay, so I just thought of something that should have been obvious. I have functions that make the module compatible with the Token module and the Diff module. I think they are hook implementations, but if not and I call them from somewhere in my own module, then they would be dependencies. I'll double check to make sure I didn't do that and fix it if I did.

#10

rconstantine - July 9, 2007 - 18:11

Well, that wasn't anything.

Can you do me a favor? Create a blank text document, then cut and paste the last five functions out of the module file into it. Save both. (the functions you move should be the token and diff related ones.) Then try installing the module again. If you don't have problems, then repeat the following procedure so we can find the problem function:

1) deactivate the module.
2) add in one function from the new text file you made, starting from the BOTTOM of this new text file (cut and paste back into the module file)
3) reactivate the module
4) if everything still works, repeat the steps with the next function until activating the module breaks and you've identified which function broke it

However, if after removing those five functions, you still can't install the module, I'm not sure what to try.

In any case, report back here.

Thanks.

#11

nashINATOR - July 23, 2007 - 04:16
Title:just blank page» Parse error

Parse error: syntax error, unexpected '=', expecting ')' in /home/profitre/public_html/test/sites/all/modules/cck_taxonomy_ssu/cck_taxonomy_ssu.module on line 948

I seem to be getting the above error. Have you found any dependencies that are lacking? It looks like the thread stopped short of how to fix this problem

The other problem i faced was while uninstalling the module using phpmyadmin.
When i set the status of the module from 1 to 0 so that my test site was usable again, it did not uninstall. I Refreshed and Refreshed again. This problem was not fixed until the module was manually deleted.

Cheers

Nash

#12

rconstantine - July 23, 2007 - 17:36

Have you tried deleting the diff and token related functions from the bottom of the module file? If you don't have those modules installed, then you don't need the functions. With that said, these are hooks for those other modules and don't call outside functions. Therefore, there shouldn't be any dependencies there. However, you can try to install the diff module, and then the token module and see if the error goes away. If it does, then I'll need to see why that is.

As for uninstalling, setting status to 0 disables, it doesn't technically uninstall, it disables. It should let you use the site like it isn't installed. And this module doesn't install anything. It does do some modifications to existing cck_taxonomy fields if you've been using that module. This module is incompatible with that one and both cannot be used at the same time.

As for the error, my IDE naturally pairs all parenthesis, and I don't have any missing or out of place, so I can't fathom why this error comes up.

Any further playing around by you guys is appreciated. I too would like to know why you are getting these errors.

#13

Christefano - July 23, 2007 - 18:33

I had the same error mentioned above when moving a local test site to the live dev site on another server. Removing the last 5 functions had my site back up.

#14

rconstantine - July 24, 2007 - 03:41

Okay, so it sounds like maybe there is a dependency problem with either the token or diff module. I'm sorry I haven't had time to do the testing myself, but I have had to migrate from one computer to a new one and not everything is where it should be just yet.

Anyway, if someone could remove one function (of those five) at a time to isolate which function is causing the error, that would be great!

ex. if the functions are numbered 1-5, start with 2, 3, 4, 5; then 1, 3, 4, 5; then 1, 2, 4, 5; then 1, 2, 3, 5; then 1, 2, 3, 4. If there is still a problem, enhance that to two functions at a time like so: 3, 4, 5; then 1, 4, 5; then 1, 2, 5; then 1, 2, 3. If there is still a problem, bump that to 3 cut out at a time, then four. We know all five out works.

Thanks again. Meanwhile, I'll call attention to this post over at the diff and token issue queues when I get a chance.

#15

Don Robertson - August 3, 2007 - 07:57

I get the same problem. I have set up drupal on my home machine, where it works fine. When I load up onto the server, I get the error.

Shameful admission:

I do not have the same versions of PHP, MySQL or Apache at home as I do on the hosted server. I installed off a Ubuntu 6.10 cd at home. I do not have internet access - it is expensive here - so doing the right thing and running the same versions is difficult. I do not control the server software on the server only the web applications like drupal.
On the server I have:

Apache version 1.3.37 (Unix)
PHP version 4.4.4
MySQL version 4.0.27-standard
cck Taxonomy Superselect version = "5.x-0.9"

so a little old. If it helps, I can get the versions from machine at home - I know I have Apache 2. something and pretty sure it is MySQL 5 - phpinfo() etc.

I also have Content Taxonomy enabled. Is this the module you are referring to when you say it is incompatible with cck_taxonomy ?

Anyway, going to the system table in the MySQL database and setting status to 0 fixed it so far - I can at least log in :-)

UPDATE `DATABASENAME`.`system` SET `status` = '0' WHERE `system`.`filename` like '%cck_taxonomy_ssu.module' ;

Should do it for you.

#16

rconstantine - August 3, 2007 - 16:45

It looks like the last function in the module file is the problem. At least, I was able to duplicate this on my live site as well. That function has to do with making the module compatible with the diff module. So for now, removing the last function should make it work. I don't think it needs to be removed if the diff module is enabled.

Yes, Content Taxonomy is what I was referring to.

#17

rconstantine - August 17, 2007 - 02:30

Oops. I meant http://drupal.org/project/cck_taxonomy, not http://drupal.org/project/content_taxonomy.

So I'm still stumped as to why this isn't working. Anyway, I'm still looking into this.

#18

rconstantine - August 17, 2007 - 08:22
Status:active» fixed

OK everybody, I'm blind. I found what I did wrong and it was so simple I looked at it a million times and didn't see it. Or I didn't believe the error message, take your pick.

Anyway, this must have changed at some point in php, so it doesn't break on my machine, but does on my remote host.

The function definition of the following function should look like this:

function cck_taxonomy_ssu_diff_new_values(&$node_part, &$result) {

I think my line is different than what you all were reporting since I have made some changes since then, so just find the line that is mostly like this and replace it.

All I did was remove "= NULL"!!! Arg!!!

Sorry it took me so long to find this one. Of course, this will be fixed in the next release.

#19

rconstantine - August 17, 2007 - 08:37

By the way, if you have a host like I do that runs both php4 and php5, go to this page admin/logs/status to see which one Drupal sees. At least, I think that should be accurate.

I know that I was using php4 until just now, so I'm not 100% sure that the issue you guys had was a php4 issue, but I think it was since I've been running 5.x at home.

My host normally uses php4 for .php files and php5 for php5 files. A simple .htaccess file with a couple of lines switches that around so that php5 is used for .php files and .php4 extensions are used with php4.

Perhaps your hosts do something similar. In any case, Drupal is going php5 only as of next February, so switch hosts soon if yours doesn't have it.

#20

Christefano - August 17, 2007 - 12:19

Thanks for the great follow through, rconstantine.

My webhost runs both PHP4 and PHP5 as well and I have Drupal running on PHP5.

#21

rconstantine - August 17, 2007 - 17:10

Drupal may simply find the existence of the 'higher' of the installed PHPs and report that whether it's actually in use or not.

So double check with how your host determines which PHP handles which files. Like I said, mine did it by file extension, and I just had to change that in .htaccess, so it may be that you have a similar situation. Normally, there won't be a reason to check which PHP is in use, but I'm confident that if you got the error above, it was run under PHP4.

#22

Christefano - August 17, 2007 - 17:20

I didn't know that about Drupal reporting the wrong version of PHP.

A while ago I added the following to Drupal's .htaccess. It may be helpful to others in this thread:

AddHandler application/x-httpd-php5 .php

#23

rconstantine - August 17, 2007 - 18:03

I'm not positive that Drupal does this, but I'm pretty sure that's what it did in my situation.

Anyway, that's the same line I added to my .htaccess, I just didn't have it in front of me to write it here. Thanks for that.

BTW, my second line was AddHandler application/x-httpd-php4 .php4

If both are set to handle the same extension, I'm not sure which one wins.

#24

Anonymous - September 4, 2007 - 03:33
Status:fixed» closed
 
 

Drupal is a registered trademark of Dries Buytaert.