Thanks, Ken, for moving this item. Knowing Diri and me, this might go back and forth a bit since we like to talk about databases and especially the ItemID. The other question was answered and I didn't want to force everyone into this fun for us, but probably not for everyone, data geek speak!

Amy
++++
Hey Diri!
First of all, I have to tell you how really freaky it was that you responded to that question. You and I have not chatted for awhile and as I was posting to that topic last night, I was thinking about you and how we have talked about this in the past.
So, that was pretty amazing to see your post!

++++
Easy Question - where is the data model?v 1.0.X -
http://img142.imageshack.us/img142/2519 ... les1ge.pngv 1.5 -
http://img395.imageshack.us/my.php?imag ... emafn6.png++++
If you have not already, spend some time with these FAQ's. Try to recreate some of those conditions.
1.
FAQ: "You are not authorized to view this resource. You need to login. <
http://forum.joomla.org/index.php/topic,19443.0.html >
2.
WIP: ItemID problems - Possible solutions/workarounds <
http://forum.joomla.org/index.php/topic,4259.0.html > PLUS: Discussion of this FAQ: four pages loaded with more issues
++++
Now, the "data model" issue.WHY THE EXISTING DATA MODEL DOES NOT WORKThe
ItemID is really a parameter -- it relates to the primary key:
id of the
jos_menu table. The
link column in this table contains the < beginnings of the > URI. The jos_menu is the
connector of any object (content, modules, components) and Joomla!. In Joomla!, ItemID is the big boss and it is used to construct the web page.
If objects (content, modules, components)
are not associated with a menu item, there will be no row in the jos_menu table. So, if these objects are referenced in some way, Joomla! is going to be confused at some point in building the page.
WHEN JOOMLA! GETS A PAGE REQUESTIt exacts the
ItemID value from the URL. It looks it up in the
jos_menu table.
Without an ItemID value, Joomla! is unable to:1. determine what
page is presented;
2. display
modules associated with that page;
3. determine who is
authorized to use that page;
4. build a correct
pathway (breadcrumbs);
5. know what
menu item to expand in the case of parent menus;
6. it has no idea which menu item should be marked as
activemenu for the CSS.
(There is obviously more, this is off the top of my head.)
Some examples of ItemID problems you have likely seen in your travels:
1. "You are not authorized to view this resource.";
2. Pathway is blank,
3. Pathway is "Home > Home",
4. Home page cannot be found (ItemID must be 1 for the first menu item of the main menu);
5. RSS feeds, related items, related modules, read more, SEF, search issues where item found in search list, but just try clicking it.
To complicate matters – over the years, little
patches have made to overcome parts of this problem, sometimes under bizarre conditions. The last thread that I asked Ken to split this discussion away from is a sad example of actually fixing a real problem but, breaking a "patch "
that really work did NOT work all the way through, but gave enough of an appearance of working since many people didn't notice the real problems.
+++++
WHAT SHOULD HAPPEN WITH THE DATA MODEL?First,
jos_menu does not contain a list of all items that can be presented in Joomla!. It is a
mid-range data structure.
A lower level structure is needed. That is where the interface interacts with the objects. The menu item is further up in the events.
So, what is the answer? Diri, I have not sat down with a tool and the code and lost myself in it. I believe this to be a
conceptual data model problem, rather than physical. And, I am fairly convinced we are
missing at least one entity and lots of relationships. My gut feel is that we are missing the
page entity, but I am not 100% certain. I would absolutely need to spend a bunch of time with it, and dig deep into the code and the interface.
Assuming a new
page table and thinking out the physical implementation, a bit, of a page table:
1. There could be
one row in the "page" table for each
content item and each
component (including the frontpage.)
2. There would also be
one row in the "page" table for each menu item.
Relationships would be to page, not menu item:
1.
Menu items would relate to "page."
2.
Modules would be displayed based on page value, not menu item.
3.
Templates would be the same.
4.
ACL would relate to the page (and other lower level objects).
5.
Searches would look there instead of through the menu.
The
breadcrumb determination would start at page to give the right most position, work its way through any related menu items, then to home on the left. Any "page" without a related menu item would default to "Home" on the left.
This should accommodate situations where content items are on multiple menu items and referenced in multiple sections and categories, as well.
For deployment,
we would be adding a table and it would have
more rows than any other table given all possible combinations, but, these would be
key values, so storage wouldn't be as enormous. Plus, you probably could logically deduce rows, too, by not actually creating the itemized content item and component rows, but look them up in their own tables. < All of that is implementation stuff; shouldn’t impact the conceptual design.. >
I am, of course, VERY interested in your take on this. You and I have discussed this before but not gotten into any detail. So, please, play with it and see what you think. I would be honored to review anything you produce on this that would help make it clear what the issue is.
But, I am very confident this is a data model problem. And, it is a conceptual model issue, rather than only physical. Only conceptual data model problems cause this type of disruption and debugging nightmares for this long.
I look forward to hearing your thoughts on this.
Thanks, Diri...Amy
