SQL View provokes fatal error on edit/ Set readonly?

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

SQL View provokes fatal error on edit/ Set readonly?

Postby miip » Wed Feb 01, 2012 11:32 pm

My DB has one view (SQL: CREATE VIEW...) composed of several joins (and self-joins). I can easily access this view as a list, browse the details or search it. As soon as I click on "edit" or "new record", xataface spits (see end of post). It isn't necessary that this view is editable, removing all buttons and links to edit functions would be good for me. How can I do this?

Thank you for your help.

Regards, Adrian.

More Infos:
- there are just ini Files, no delegate classes
- there are SQL queries in valuelists.ini
- the view is defined as
Code: Select all
CREATE OR REPLACE VIEW established_link AS 
   SELECT startp.*, endp.device_id AS end_device_id, endp.name AS end_name,
         startloc.building_id, endloc.building_id AS end_building_id,
         startdev.location_id, enddev.location_id AS end_location_id,
         startdev.device_type_id, enddev.device_type_id AS end_device_type_id             
      FROM port AS startp INNER JOIN port AS endp
                            ON startp.link_id = endp.link_id AND startp.id <> endp.id
                       LEFT JOIN switch_pp AS startdev
                            ON startp.device_id = startdev.id 
                       LEFT JOIN switch_pp AS enddev
                             ON endp.device_id = enddev.id
                       LEFT JOIN location AS startloc
                           ON startdev.location_id = startloc.id
                         LEFT JOIN location AS endloc
                              ON enddev.location_id = endloc.id;


The error it throws, when clicking on "edit" in "detail" or "new record" in "list", is:
Code: Select all
Fatal error: [html_quickform_error: message="unregistered element" code=-5 mode=return level=notice prefix="QuickForm Error: " info="Element 'tex' does not exist in HTML_QuickForm::_loadElement()"]On line 404 of file /usr/local/share/xataface-1.3rc6/Dataface/FormTool.php in function printStackTrace()
On line 345 of file /usr/local/share/xataface-1.3rc6/Dataface/QuickForm.php in function buildWidget(Dataface_Record Object,array(description,varchar(100),YES,,,,established_link,array(Beschreibung,,established_link.descript,Dataface_QuickForm Object,description,1,array(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,)
On line 486 of file /usr/local/share/xataface-1.3rc6/Dataface/QuickForm.php in function _buildWidget(array(description,varchar(100),YES,,,,established_link,array(Beschreibung,,established_link.descript,array(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,)
On line 53 of file /usr/local/share/xataface-1.3rc6/a in /usr/local/share/xataface-1.3rc6/Dataface/FormTool.php on line 404
miip
 
Posts: 5
Joined: Wed Feb 01, 2012 10:47 pm

Re: SQL View provokes fatal error on edit/ Set readonly?

Postby shannah » Thu Feb 02, 2012 8:44 am

Are there any fields in this view that begin with "tex" or contain "tex" in the name?
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: SQL View provokes fatal error on edit/ Set readonly?

Postby miip » Thu Feb 02, 2012 9:16 am

...how stupid... yes, indeed, I wrote widget:type=tex instead of text... Thank you!

To make it read-only anyway, how would it be done? I saw that with "show_actions_menu" is only globally applicable not on individual views resp. tables. Is there another way?
miip
 
Posts: 5
Joined: Wed Feb 01, 2012 10:47 pm

Re: SQL View provokes fatal error on edit/ Set readonly?

Postby shannah » Thu Feb 02, 2012 9:52 am

You want the whole table/view to be read only? Use permissions.
e.g. in the delegate class:
Code: Select all
function getPermissions($record){
    return Dataface_PermissionsTool::READ_ONLY();
}


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

Re: SQL View provokes fatal error on edit/ Set readonly?

Postby miip » Wed Feb 08, 2012 10:13 am

Thank you, exactly what I needed!

Best regards, Adrian.
miip
 
Posts: 5
Joined: Wed Feb 01, 2012 10:47 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 21 guests

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