Problems with related records
Archived from the Xataface Users forum.
chus_leon — Wed Jun 13, 2007 7:01 am
Hello again
I’ve got a problem with the related records… First when I try to export the related records, the program saves only the main records, not the related. The relationship was created via $parentfield=table.field in the relationships.ini file:
[equipos]
equipo.eqCliCod=”$cliCod”
actions:addexisting=0
In addition, I receive a Fatal error when I try to delete or update a related record using the ‘with selected’ buttons. This one:
Fatal error: Call to undefined method PEAR_Error::getTitle() in K:\wamp\www\mantenimiento\dataface\Dataface\templates_c\default\%%2E^2EA^2EA26F76%%copy_replace.html.php on line 33
I’m using the getTitle() function on my tables.php files but even deleting the function, the error persists.
Somebody knows what’s happen? Thanks
Jesus
shannah — Wed Jun 13, 2007 9:20 am
Hi Jesus,
Thanks for the bug report.Ê For the export csv function, here is the fix.Ê Open the actions.ini file in Dataface, and find the [export_csv_related] section.Ê The url line for this is
url = “{$this->url(‘-action=export_csv&–related=1’)”
change it to
url = “{$this->url(‘-action=export_csv’)&–related=1”
I’m looking into the other issues.Ê Will get back to you shortly.
Best regards
Steve
shannah — Wed Jun 13, 2007 9:31 am
Hi Jesus,
Can you send me a copy of the HTML source for the related records page in question.Ê I’m interested in the page with the checkboxes.Ê I’m wondering if some of the special characters that would appear in Spanish are causing some problems…
Thanks
-Steve
chus_leon — Thu Jun 14, 2007 3:21 am
Thanks for this first solution.
The html code returned is the next:
Warning: Invalid argument supplied for foreach() in K:\wamp\www\mantenimiento\dataface\actions\copy_replace.php on line 58
Warning: array_keys() [function.array-keys]: The first argument should be an array in K:\wamp\www\mantenimiento\dataface\actions\copy_replace.php on line 158
Warning: Invalid argument supplied for foreach() in K:\wamp\www\mantenimiento\dataface\actions\copy_replace.php on line 158
Buscar/Reemplazar registros
This form allows you to perform batch updates on all of the selected
records. Use the form below to specify values to be placed in
any field.
Seleccionados:
| Title |
| Codigo de Cliente |
| Fatal error: Call to undefined method PEAR_Error::getTitle() in K:\wamp\www\mantenimiento\dataface\Dataface\templates_c\default\%%2E^2EA^2EA26F76%%copy_replace.html.php on line 33 It appears like an error on the copy_replace.php file Regards |
shannah — Thu Jun 14, 2007 10:20 am
Hi Jesus,
Actually it looks like the forum stripped out a lot of the HTML.Ê If you can send it to my email that would be good.Ê What I want to look at is the related list with the checkboxes… the HTML for the entire page so I can see what is being placed into the hidden form fields…
Thanks
Steve
sstoddard — Fri Aug 31, 2007 11:14 am
I just got the same error. Is there a fix? It only happens with Update selected fields.
Warning: Invalid argument supplied for foreach() in /var/www/dataface/actions/copy_replace.php on line 58
Warning: array_keys() [function.array-keys]: The first argument should be an array in /var/www/dataface/actions/copy_replace.php on line 160
Warning: Invalid argument supplied for foreach() in /var/www/dataface/actions/copy_replace.php on line 160
Find/Replace Form
This form allows you to perform batch updates on all of the selected
records. Use the form below to specify values to be placed in
any field.
Selected records:
| Title |
| Codigo de casa |
| Fatal error: Call to a member function getTitle() on a non-object in /var/www/dataface/Dataface/templates_c/dataface/%%2E^2EA^2EA26F76%%copy_replace.html.php on line 33 |
shannah — Fri Aug 31, 2007 2:55 pm
In Jesus’ case, I never found out what the problem was exactly.Ê He said that he had made a mistake with his table definitions or something.
So no fix was necessary.Ê You may have a different problem. Hard to tell without looking at:
-
The previous page (the one with the checkboxes that you selected to decide which records to copy/update)
-
The resulting form (that you have already posted here… but the forum seems to muck with it).Ê IfÊ you can send them to my email that would be easier.
-Steve
sstoddard — Wed Sep 12, 2007 5:02 pm
So it seems to be a problem only when trying to update rows when looking at related records, not if one goes to the table itself. I’ll send a link where you can have a look yourself.
-Steve
shannah — Thu Sep 13, 2007 1:20 am
OK.. the fix for this issue in version 0.7.1 is:
In the Dataface/Record.php file on line 919 you’ll see:
$this->cache[__FUNCTION__][$fieldname][$index][$where][$sort] =& $rec[$fieldname];
Change it to:
$this->cache[__FUNCTION__][$relationship.’.’.$fieldname][$index][$where][$sort] =& $rec[$fieldname];