Closed (fixed)
Project:
Data
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 Oct 2009 at 04:53 UTC
Updated:
5 Jan 2012 at 19:55 UTC
Jump to comment: Most recent file
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.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 616324-3_adopt.patch | 6.71 KB | alex_b |
| data_view.patch | 3.73 KB | becw |
Comments
Comment #1
alex_b commentedYou 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.
Comment #2
alex_b commentedDrats. wrong thread. Please ignore #1
Comment #3
arski commentedhmm, I had the same issue.. tried adding a primary key to my table, re-adopting it, but still I can't view it - the link is there but it just redirects to a list of tables without giving any information. Very sad :((
pretty old bug too it seems :(
Comment #4
joachim commentedUpping version so I remember to fix this on D7.
Comment #5
joachim commentedCommitted to both D6 and D7 branches, with tweaks on the latter.
- #616590 by becw: Fixed links to non-existent views for tables without primary keys.
- #616590 by becw, joachim: Fixed links to non-existent views for tables without primary keys.
Comment #7
brandy.brown commentedCan we get links to the patches? I don't know how to find them otherwise.
Thanks!
Comment #8
brandy.brown commentedComment #9
brandy.brown commentedwell magically I went back (without patching) and it works just fine. WEIRD.