Problems with related records

A place for users and developers of the Xataface to discuss and receive support.

Postby 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
chus_leon
 
Posts: 12
Joined: Wed Dec 31, 1969 5:00 pm

Postby 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

--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby 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

--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby 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:










TitleCodigo 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
chus_leon
 
Posts: 12
Joined: Wed Dec 31, 1969 5:00 pm

Postby 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
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby 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
sstoddard
 
Posts: 14
Joined: Wed Dec 31, 1969 5:00 pm

Postby 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:

1. The previous page (the one with the checkboxes that you selected to decide which records to copy/update)

2. 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

--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby 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

sstoddard
 
Posts: 14
Joined: Wed Dec 31, 1969 5:00 pm

Postby 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];

--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 38 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved