I closed the other issue. I didn't bring over all the pieces of ajax, thought the other stuff was for ajax chat.

this is the only one i have now

warning: Cannot use a scalar value as an array in ~/modules/recipe/recipe.module on line 549.

Comments

green monkey’s picture

Hi Thox,
I've been trying to trap this error, to help, with what little I know.

I deleted all recipes and tables and reloaded /recipe.

I have only entered one recipe and below are the results.

1) when saved - it saved two copies of recipe

2) I used teaspoon, tablespoon, cup - ingredients were not saved.

3) added an image - displayed ok

4) enable 'rich-text" (tinyMCS is now working) changed my theme... but

5) when editing "Additional Notes" edit window is only one line high - to see and and edit, can scroll - but one line display very cumbersome and I don't think users will figure it out

6) I have noticed that I am getting this error 5 times now, which is also equal to the number of line item ingredients I added

"warning: Cannot use a scalar value as an array in /hsphere/local/home/jwells/secondwindlifestyle.com/modules/recipe/recipe.module on line 549."

and when doing an 'Edit and Submit"
I see the above error 10 times (2 copies times 5 line item ingredients) and I also get these three errors below the line 549 errors

warning: Invalid argument supplied for foreach() in /hsphere/local/home/jwells/secondwindlifestyle.com/modules/recipe/recipe.module on line 492.

warning: Invalid argument supplied for foreach() in /hsphere/local/home/jwells/secondwindlifestyle.com/modules/recipe/recipe.module on line 504.

warning: Cannot modify header information - headers already sent by (output started at /hsphere/local/home/jwells/secondwindlifestyle.com/includes/common.inc:384) in /hsphere/local/home/jwells/secondwindlifestyle.com/includes/common.inc on line 192.

here is a link if that helps you in anyway

http://secondwindlifestyle.com/taxonomy/term/2

thanks and appericate any help you can offer

green monkey’s picture

after the last post, I thought i would browse the tables

main_recipe_node_ingredient (had 10 line items - same lines but id num +1 for second group

main_recipe_ingredient (had 5 line items - all as entered)

please let me know if there is anything else i can forward

Thox’s picture

What version of PHP do you use?

What confuses me is that the "scalar" in question is not a scalar, it's an array. This is what's causing your problems, and I have no idea how it is happening.

green monkey’s picture

PHP 4.3.11

I can email you an url for phpinfo.php, if you need or it would help

I was thinking if you're not having problems and I am, could there be a difference between the metric and american arrays?

If you want, email me your recipe.module and I'll give it a run ~ anything I can do to help?

green monkey’s picture

I found this - but don't laugh - I don't have a clue what it means roor what they are talking about

http://drupal.org/node/22883

green monkey’s picture

what verison of php are you using and test on?

Thox’s picture

I develop on PHP 5.0.4, but I have a site working fine on 4.3.11 too.

green monkey’s picture

I know this might sound dumb or silly to you, but would you mind emailing me a copy of your working recipe.module - but I think we're at the point of trying the non-obvious stuff. I guess the 4.3.11 site would be the best, is this possible?

please................ I don't have any other ideas

Thox’s picture

I use the recipe module straight from Drupal's CVS. Please could you show me the contents of line 549 in your copy, because in CVS that line only contains }.

green monkey’s picture

Thox,
what ever i can do. I truly appericate your help on this matter.

lines 548 - 553
while ($ingredient = db_fetch_object($rs)) {
$ingredient[] = $ingredient;
}
return $ingredient;
}

.... did i goof a patch?

thanks

Thox’s picture

Assigned: Unassigned » Thox
Status: Active » Closed (works as designed)

I don't understand how you have that in your code, but I can suggest checking out a new copy of the module from CVS. The problem line should actually be this: $ingredients[] = $ingredient;

green monkey’s picture

I'll try that.. Thanks

I had a feeling it was something dumb or simple. Its about 2am, so I'll let you know tomorrow

thanks again