Page 1 of 1

relationships.ini (error : scalar value instead of array)

PostPosted: Wed May 06, 2009 8:59 am
by olivier_rosec
Hello,

when setting up a many to many relationship between two tables through a relationships.ini file I get the same error all the time whichever syntax I use among the three possible ways of doing it described in Xataface's documentation.

[i](this message refers to the example app I set up so as to understand better what was going on : same error)[/i]

[code][pear_error: message="Parse error: Unknown action :s on line 1 select * from Course, ProgramCourses where Course.CourseID=ProgramCourses.CourseID and ProgramCourses.ProgramID='$ProgramID' ^ found: "s"" code=0 mode=return level=notice prefix="" info=""]
Warning: Invalid argument supplied for foreach() in /space/www/gl-ouv/1/6/1612031805215032/web/ouvaton.org/shakennotstirred.ouvaton.org/html/alpha/xataface/Dataface/Relationship.php on line 351

Warning: Cannot use a scalar value as an array in /space/www/gl-ouv/1/6/1612031805215032/web/ouvaton.org/shakennotstirred.ouvaton.org/html/alpha/xataface/Dataface/Relationship.php on line 558

Etc.[/code]

I scanned the whole forum for similar issues. Apparently it might be a problem either with the encoding of the files themselves when I FTP them to the shared host I am using, or it might be something like the PHP and MySQL settings on the host ?

I tried several flavours of quotes and even backticks around '$ProgramID' as it seems to me that the relationship PHP script isn't decoding this variable properly.

Thank you for any help

OR

PostPosted: Wed May 06, 2009 9:47 am
by shannah
Can you post the relevant relationships.ini file?

PostPosted: Wed May 06, 2009 11:35 pm
by olivier_rosec
Hello Steve,

in the end I decided to save the .ini file under Ultraedit with Unix linebreaks and a UTF-8 encoding and this is what I get from my host


[code]Fatal error: Call to undefined method: pear_error->getordercolumn() in /space/www/gl-ouv/1/6/1612031805215032/web/ouvaton.org/shakennotstirred.ouvaton.org/html/alpha/xataface/Dataface/Record.php on line 779[/code]

Here is the relevant relationships.ini file

[Courses]
Course.CourseID = ProgramCourses.CourseID
ProgramCourses.ProgramID = "$ProgramID"

OR

PostPosted: Thu May 07, 2009 9:58 am
by shannah
OK... this is still very strange. Since your getting different results with different character encodings I suspect that it could be the result of hidden characters still being placed in your relationships.ini file by your text editor.

I don't use Windows generally but I do know that Crimson Editor is a good free text editor that doesn't tend to muck with the files (and seems to work well).

Everything else looks fine in the relationships.ini file that you posted.

If you want you can attach the relationships.ini file to me in an email and I can inspect it closer for encoding etc..

steve@weblite.ca