viewing table content via the data table content page

bec - October 28, 2009 - 04:53
Project:Data
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

If a table doesn't have either a primary key or a join to another table with a primary key, then its contents can't be displayed on the admin/content/data/view/my_table_name path. However, the link to view the table contents still shows. I think it would be a good idea to add some help text and change or hide the link.

Additionally, in the table content view itself, the column header in the view is empty instead of showing the field name if the field's label is blank.

The attached patch is one way to fix these two things.

AttachmentSize
data_view.patch3.73 KB

#1

alex_b - October 28, 2009 - 14:24

You ran headlong into an issue I wanted to address earlier. The fact that putting clearing caches into CRUD functions isn't efficient if these functions are being batched.

The way how I'd like to address this is having no cache clear / rebuild functionality in CRUD methods at all and make it the API user's responsibility to clear caches after operations. I added DataTable::cacheClear() and modified the adopt patch accordingly as a first step in the right direction.

Other changes:

- Passing in the table name into adopt is redundant
- Minor tweaks to naming conventions to keep consistent with rest of code (i. e. call table $table, not $tmp. Nitty gritty stuff)
- unset() table pointer after adopting the table.
- Make $schema an optional parameter for adopt() so that API users can rely on DataTable to inspect the table. This keeps adopt() more in the pattern of create().

Needs review.

AttachmentSize
616324-3_adopt.patch 6.71 KB

#2

alex_b - October 28, 2009 - 14:25

Drats. wrong thread. Please ignore #1

 
 

Drupal is a registered trademark of Dries Buytaert.