How do I fix syntax error, artiseer theme


Author Message
Menita

Posted: 9/22/2010
Quote message 

So I installed the updated artiseer and for the first time ever I am having trouble please assist.

I created a theme called wmd which I uploaded to my drupal site and for the firts time ever received this error message, its a syntax error for this php file: common_methods.php, how do I fix this??????
See below:


Parse error: syntax error, unexpected '{' in /homepages/39/d315291643/htdocs/wmd/drupal-6.19/themes/wmd/common_methods.php on line 41
 
Lawrence

Posted: 9/25/2010
Quote message 

I know some Artisteer users were getting this issue when they've used JSMin+. Are you using http://drupal.org/project/javascript_aggregator module? What performance modules are you using if any. Also, any additional details you can provide? This will help us help you better. :-)
 
Kai

Posted: 9/25/2010
Quote message 

I have the same problem -- I do not use javascript_aggregator -- i only use the core modules
 
Lawrence

Posted: 9/25/2010
Quote message 

I highly doubt this is the problem, but could you create a sub folder in your sites/all/ directory called "themes"? Place your Artisteer theme there. This will most likely not fix your issue, but should be common Drupal practice as it makes upgrading much easier. If you haven't added a "modules" folder there, now's a great time as well. Drupal auto-detects these folders.

As for the common_methods.php error, line 41 for me is this.
<div id="$parent_id">$content</div>

Here's your error,
Parse error: syntax error, unexpected '{'

It's calling an unexpected { symbol. Perhaps removing that fixes your problem? Be sure to backup that individual file when editing it for quick restoration.
 
Kai

Posted: 9/29/2010
Quote message 

Thanks for answer and the hint with the sub folders.

But removing any { has not helped.
For my line 41 is the 4th line of this function:

function art_menu_xml_parcer($content, $show_sub_menus, $menu_class) {
$parent_id = $menu_class . '-id';
try {
$doc = art_xml_loader($content, $parent_id);
}
catch(Exception $e) {
return $content;
}

$parent = $doc->documentElement;
$elements = $parent->childNodes;

$ul_children = NULL;
foreach($elements as $element) {
if ($element->tagName != "ul") continue;
$ul_children = $element->childNodes;
break;
}

if ($ul_children == NULL) return $content;
$ul_children = art_menu_style_parcer($doc, $ul_children, $show_sub_menus);

return $doc->saveHTML();
}
 
Lawrence

Posted: 9/30/2010
Quote message 

I'm gonna ask, what PHP version are you using? Maybe this is relevant, some people experience these errors between upgrades from major releases.

Other than that, this error usually occurs when a curly bracket is missing. This is probably not right, but try adding this, see below.

Add -----> }
After ----> $parent_id = $menu_class . '-id';

Copy in the quotes " $parent_id = $menu_class . '-id'; " - CTRL + F, CTRL + V.

Save and check if the error persists. Make sure you make a backup of the file you edit.
 
Lawrence

Posted: 9/30/2010
Quote message 

One more thing, don't forget to clear your cache! :-)
 
Kason Cupid

Posted: 10/6/2010
Quote message 

I'm having same proble and I disabled all my modules. I'm very interested in using artisteer but I obviously can't purchase if it isn't working with my site
 
David

Posted: 10/10/2010
Quote message 

The "Try {" function found on line 41 only works in php 5. If you are running php4 you will get an error like the above.

I don't use Godaddy hosting, but as I understand it from other chatter, their default install uses php4 which also breaks other Drupal functionality such as Imagefield. I understand that php5 is available but that's something you would need to address with Godaddy.
 
Yvonne

Posted: 10/10/2010
Quote message 

I have found a solution.
My server was running php 4
I added this line to the end of the .htaccess file :


AddType x-mapp-php5 .php .php4

and hey presto! it now works.

I learned a lot too!


To find out what version you are rumnning write a file called phpversion.php and put in it:

<?php
echo "The current PHP version being used is: " . phpversion ( );
?>

put it in the site's root directory and access it by: goung to hour home page and adding /phpversion.php in the address bar.

Hope ths helps
 
ashiwebi

Posted: 3/19/2011
Quote message 

I am also having the same problem. I have php4. This is driving me crazy. :(
 
i7nvd

Posted: 3/19/2011
Quote message 

@ashiwebi

Yvonne's solution is right. You need to tell your host to run PHP5.