metafields:order problem when underscore in table name

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

metafields:order problem when underscore in table name

Postby tomhousley » Fri Oct 22, 2010 1:46 pm

Hello,

I thjnk there may be a bug in xataface 1.2.5 (this may well be present in earlier versions). If it's not a bug, then if someone could suggest what i'm doing wrong.

In a nutshell when i have a relationship.ini for a table called cms_pages like this:

Code: Select all
[Menus]
cms_menus.men_id = cms_page_menus.men_id
cms_page_menus.pag_id = "$pag_id"
action:label = "Top Menus On This Page"
metafields:order = "pgm_order"


The dragging of records to reorder them doesnt work.

If I rename the table from cms_pages to cmspages, it does work.

My apache log throws up a few errors when I have an underscore in the table name.

I can get round it, but for uniformity's sake, I like to have consistent naming with my tables.

Any ideas?

Thank you, Tom
tomhousley
 
Posts: 52
Joined: Thu Feb 26, 2009 1:02 am
Location: United Kingdom

Re: metafields:order problem when underscore in table name

Postby shannah » Sat Oct 23, 2010 8:59 am

What errors show up in the Apache log?
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: metafields:order problem when underscore in table name

Postby tomhousley » Sat Oct 23, 2010 1:04 pm

here it is:

Code: Select all
[Sat Oct 23 20:53:10 2010] [error] [client 217.42.152.54] PHP Fatal error:  Error performing mysql query to get column information from table 'pages'.  The mysql error returned was : 'Table 'web111-cms0_2.pages' doesn't exist'., referer: http://www.example.com/cms/cms_0.2/admin.php?-table=cms_pages&-action=related_records_list&-cursor=1&-skip=0&-limit=30&-mode=list&-recordid=cms_pages%3Fpag_id%3D2&-relationship=Menus
[Sat Oct 23 20:53:10 2010] [error] [client 217.42.152.54] <br>On line 477 of file /home/sites/example.com/public_html/cms/cms_0.2/xataface/Dataface/Table.php in function printStackTrace(), referer: http://www.example.com/cms/cms_0.2/admin.php?-table=cms_pages&-action=related_records_list&-cursor=1&-skip=0&-limit=30&-mode=list&-recordid=cms_pages%3Fpag_id%3D2&-relationship=Menus
[Sat Oct 23 20:53:10 2010] [error] [client 217.42.152.54] <br>On line 2349 of file /home/sites/example.com/public_html/cms/cms_0.2/xataface/Dataface/Table.php in function Dataface_Table(pages,Resource id #11,), referer: http://www.example.com/cms/cms_0.2/admin.php?-table=cms_pages&-action=related_records_list&-cursor=1&-skip=0&-limit=30&-mode=list&-recordid=cms_pages%3Fpag_id%3D2&-relationship=Menus
[Sat Oct 23 20:53:10 2010] [error] [client 217.42.152.54] <br>On line 195 of file /home/sites/example.com/public_html/cms/cms_0.2/xataface/Dataface/Record.php in function loadTable(pages), referer: http://www.example.com/cms/cms_0.2/admin.php?-table=cms_pages&-action=related_records_list&-cursor=1&-skip=0&-limit=30&-mode=list&-recordid=cms_pages%3Fpag_id%3D2&-relationship=Menus
[Sat Oct 23 20:53:10 2010] [error] [client 217.42.152.54] <br>On line 221 of file /home/sites/example.com/public_html/cms/cms_0.2/xataface/dataface-public-api.php in function Dataface_Record(pages,array()), referer: http://www.example.com/cms/cms_0.2/admin.php?-table=cms_pages&-action=related_records_list&-cursor=1&-skip=0&-limit=30&-mode=list&-recordid=cms_pages%3Fpag_id%3D2&-relationship=Menus
[Sat Oct 23 20:53:10 2010] [error] [client 217.42.152.54] <br>On line 2304 of file /home/sites/example.com/public_html/cms/cms_0.2/xataface/Dataface/IO.php in function df_get_record(pages,array(2)), referer: http://www.example.com/cms/cms_0.2/admin.php?-table=cms_pages&-action=related_records_list&-cursor=1&-skip=0&-limit=30&-mode=list&-recordid=cms_pages%3Fpag_id%3D2&-relationship=Menus
[Sat Oct 23 20:53:10 2010] [error] [client 217.42.152.54] <br>On line 244 of file /home/sites/example.com/public_html/cms/cms_0.2/xataface/dataface-public-api in /home/sites/example.com/public_html/cms/cms_0.2/xataface/Dataface/Table.php on line 477, referer: http://www.example.com/cms/cms_0.2/admin.php?-table=cms_pages&-action=related_records_list&-cursor=1&-skip=0&-limit=30&-mode=list&-recordid=cms_pages%3Fpag_id%3D2&-relationship=Menus


Using 'Tamper Date' for Firefox, the POSTDATA is as follows:
tablename: cms_pages
Code: Select all
relatedList-body%5B%5D=pages/Menus?pag_id=2&Menus%3A%3Amen_id=1&Menus%3A%3Apag_id=2
relatedList-body%5B%5D=pages/Menus?pag_id=2&Menus%3A%3Amen_id=3&Menus%3A%3Apag_id=2
relatedList-body%5B%5D=pages/Menus?pag_id=2&Menus%3A%3Amen_id=2&Menus%3A%3Apag_id=2
relatedList-body%5B%5D=pages/Menus?pag_id=2&Menus%3A%3Amen_id=4&Menus%3A%3Apag_id=2
relatedList-body%5B%5D=pages/Menus?pag_id=2&Menus%3A%3Amen_id=7&Menus%3A%3Apag_id=2
-table=cms_pages
-action=related_records_list
-action=reorder_related_records
-cursor=1
-skip=0
-limit=30
-mode=list
-recordid=cms_pages?pag_id=2
-relationship=Menus


Though when using a table without an underscore, the POSTDATA is shown as follows:
tablename: cmspages
Code: Select all
relatedList-body%5B%5D=cmspages/Menus?pag_id=1&Menus%3A%3Amen_id=1&Menus%3A%3Apag_id=1
relatedList-body%5B%5D=cmspages/Menus?pag_id=1&Menus%3A%3Amen_id=4&Menus%3A%3Apag_id=1
relatedList-body%5B%5D=cmspages/Menus?pag_id=1&Menus%3A%3Amen_id=2&Menus%3A%3Apag_id=1
relatedList-body%5B%5D=cmspages/Menus?pag_id=1&Menus%3A%3Amen_id=3&Menus%3A%3Apag_id=1
relatedList-body%5B%5D=cmspages/Menus?pag_id=1&Menus%3A%3Amen_id=5&Menus%3A%3Apag_id=1
-table=cmspages
-action=related_records_list
-action=reorder_related_records
-cursor=0
-skip=0
-limit=30
-mode=list
-recordid=cmspages?pag_id=1
-relationship=Menus


In the above cases, xataface powers a heavily modified version of your LCMS.
tomhousley
 
Posts: 52
Joined: Thu Feb 26, 2009 1:02 am
Location: United Kingdom

Re: metafields:order problem when underscore in table name

Postby shannah » Sat Oct 23, 2010 1:36 pm

Thanks for the error readout. I'll look into it.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: metafields:order problem when underscore in table name

Postby shannah » Sat Oct 23, 2010 1:58 pm

OK.. I haven't tested this fix out yet, but I think it should work. Please let me know how it goes. (Note that since the fix is javascript related, you may need to empty your cache to ensure that the new files are used instead of an old cached version.

The fix is in SVN revision 1951. You can just replace the following file in your distribution:

http://weblite.ca/svn/dataface/core/tru ... ragdrop.js

Again, please let me know if this fixes the issue for you. If not, I'll have to set up a full test environment to get this one fixed.

-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: metafields:order problem when underscore in table name

Postby tomhousley » Sat Oct 23, 2010 2:40 pm

Hi Steve,

Thank you for your prompt action!

Unforunately, this doesn't seem to have fixed the problem.

I can work around this, so please don't put yourself out on my account.

Will be good when it works though.

All the best, Tom
tomhousley
 
Posts: 52
Joined: Thu Feb 26, 2009 1:02 am
Location: United Kingdom

Re: metafields:order problem when underscore in table name

Postby shannah » Sat Oct 23, 2010 2:56 pm

Can you post the error messages with this current fix so I can see the changes.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: metafields:order problem when underscore in table name

Postby tomhousley » Sat Oct 23, 2010 3:37 pm

Code: Select all
[Sat Oct 23 23:40:55 2010] [error] [client 217.42.152.54] PHP Fatal error:  Error performing mysql query to get column information from table 'pages'.  The mysql error returned was : 'Table 'web118-training.pages' doesn't exist'., referer: http://example.com/wip/training/admin.php?-table=cms_pages&-action=related_records_list&-cursor=0&-skip=0&-limit=30&-mode=list&-recordid=cms_pages%3Fpag_id%3D1&-relationship=Menus
[Sat Oct 23 23:40:55 2010] [error] [client 217.42.152.54] <br>On line 477 of file /home/sites/example.com/public_html/xataface-1.2.5/Dataface/Table.php in function printStackTrace(), referer: http://example.com/wip/training/admin.php?-table=cms_pages&-action=related_records_list&-cursor=0&-skip=0&-limit=30&-mode=list&-recordid=cms_pages%3Fpag_id%3D1&-relationship=Menus
[Sat Oct 23 23:40:55 2010] [error] [client 217.42.152.54] <br>On line 2349 of file /home/sites/example.com/public_html/xataface-1.2.5/Dataface/Table.php in function Dataface_Table(pages,Resource id #11,), referer: http://example.com/wip/training/admin.php?-table=cms_pages&-action=related_records_list&-cursor=0&-skip=0&-limit=30&-mode=list&-recordid=cms_pages%3Fpag_id%3D1&-relationship=Menus
[Sat Oct 23 23:40:55 2010] [error] [client 217.42.152.54] <br>On line 195 of file /home/sites/example.com/public_html/xataface-1.2.5/Dataface/Record.php in function loadTable(pages), referer: http://example.com/wip/training/admin.php?-table=cms_pages&-action=related_records_list&-cursor=0&-skip=0&-limit=30&-mode=list&-recordid=cms_pages%3Fpag_id%3D1&-relationship=Menus
[Sat Oct 23 23:40:55 2010] [error] [client 217.42.152.54] <br>On line 221 of file /home/sites/example.com/public_html/xataface-1.2.5/dataface-public-api.php in function Dataface_Record(pages,array()), referer: http://example.com/wip/training/admin.php?-table=cms_pages&-action=related_records_list&-cursor=0&-skip=0&-limit=30&-mode=list&-recordid=cms_pages%3Fpag_id%3D1&-relationship=Menus
[Sat Oct 23 23:40:55 2010] [error] [client 217.42.152.54] <br>On line 2304 of file /home/sites/example.com/public_html/xataface-1.2.5/Dataface/IO.php in function df_get_record(pages,array(1)), referer: http://example.com/wip/training/admin.php?-table=cms_pages&-action=related_records_list&-cursor=0&-skip=0&-limit=30&-mode=list&-recordid=cms_pages%3Fpag_id%3D1&-relationship=Menus
[Sat Oct 23 23:40:55 2010] [error] [client 217.42.152.54] <br>On line 244 of file /home/sites/example.com/public_html/xataface-1.2.5/dataface-public-api.php in function getByID(pages/Menus?pag_id=1&Menus::men_i in /home/sites/example.com/public_html/xataface-1.2.5/Dataface/Table.php on line 477, referer: http://example.com/wip/training/admin.php?-table=cms_pages&-action=related_records_list&-cursor=0&-skip=0&-limit=30&-mode=list&-recordid=cms_pages%3Fpag_id%3D1&-relationship=Menus


This is on a different site than the error message I posted earlier, but seems to throw up same problems even with the new javascript.

I cleared the cache on my firefox and also tried it on IE, but still no luck when I have an underscore in table name.

Thank you, Tom
tomhousley
 
Posts: 52
Joined: Thu Feb 26, 2009 1:02 am
Location: United Kingdom

Re: metafields:order problem when underscore in table name

Postby shannah » Sat Oct 23, 2010 3:42 pm

Actually the apache log was more informative, as the error apparently happens in javascript before the ajax request is made to save the orders.
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 26 guests

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