Parse error: syntax error, unexpected '' in LaunguageTool.php

566 views
Skip to first unread message

Nid

unread,
Jul 24, 2016, 3:55:15 AM7/24/16
to Xataface
Hello Eveyone,

I get this error:

Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) inC:\Nidaren\rff\xataface\Dataface\LanguageTool.php(222) : eval()'d code on line 2

when trying to add New Related Record on details of main record.

Thanks for any suggestions on how to fix it!

Nid

unread,
Jul 24, 2016, 5:17:25 AM7/24/16
to Xataface
EDIT:

I found that removing the following code from new_related_record.php action on line 98:

"Record successfully added to ".$rel->getLabel()." relationship.\n"

fixes the error however the success message is then dissorted.

Any tips on how to make it right?

Thanks in advance.

dave.t...@gmail.com

unread,
Sep 16, 2016, 12:29:04 PM9/16/16
to Xataface
It looks like the deal with this is that recent versions of PHP have changed the behavior of heredocs, and this has caused the language files to be retroactively-bogus.

They all need to be gone through and rewritten to deal with the new heredoc behavior.

For example, to fix this one message in the en local:


Record successfully added to relationship = "Record successfully added to "XATAFACEE"$query['-relationship']"XATAFACEQ" relationship.\n"

  should be changed in lang/en.ini, to:

Record successfully added to relationship = "Record successfully added to {$query['-relationship']} relationship."
 
There are dozens of other places where this sort of thing is happening.  =/

-D

dave.t...@gmail.com

unread,
Sep 16, 2016, 12:32:27 PM9/16/16
to Xataface

Oh, and I forgot to mention - in addition to the syntax error, the language tool is always returning the default text in this place, because that $query variable is mistakenly not passed.

So, please also modify actions/new_related_record.php:


                                                Dataface_LanguageTool::translate(
                                                        "Record successfully added to relationship",
                                                        "Record successfully added to ".$rel->getLabel()." relationship...",
                                                        array('relationship'=>$rel->getLabel())
                                                ).
                                                (isset($response['--msg']) ? $response['--msg'] : '')


  becomes


                                                Dataface_LanguageTool::translate(
                                                        "Record successfully added to relationship",
                                                        "Record successfully added to ".$rel->getLabel()." relationship...",
                                                        array('relationship'=>$rel->getLabel(), 'query'=>$query)
                                                ).
                                                (isset($response['--msg']) ? $response['--msg'] : '')


   I guess I'll go ahead and submit a bug report.

  -D

Steve Hannah

unread,
Sep 16, 2016, 12:46:35 PM9/16/16
to xata...@googlegroups.com
Thanks.  Looks like the language files were out of date.  I have regenerated them from the translations spreadsheet and committed to git.  Should be fixed now without needing to pass $query.

Steve

--
You received this message because you are subscribed to the Google Groups "Xataface" group.
Visit this group at https://groups.google.com/group/xataface.
To view this discussion on the web visit https://groups.google.com/d/msgid/xataface/fc7ab33a-ab58-493d-8d0c-29e0e9a811fc%40googlegroups.com.



--
Steve Hannah
Web Lite Solutions Corp.
Reply all
Reply to author
Forward
0 new messages