Error loading Components: ปัญหา Joomla Component menu หาย


Error loading Components: แก้ไขยังไม่ได้

You probably encountered this message when trying to create your own component and you went hundred of times trough your code tying to find out what you did wrong, not to mention you probably reinstalled Joomla several times.

A friend of mine had the same issues and he was a bit luckier than me - he found a post on the Joomla forums:

"When we created the install file for our Joomla component, by using the MySQL export function, there was a line at the top of the file that said:
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

This means that when a row is inserted with the Primary Key as '0', the ID# stays as zero. That's an issue. In Joomla 1.5, when components are installed, Joomla defaults to setting the component ID# to zero when adding the component name and details to the `#__components` table. This table has a field called "parent" which will be used if the menu item is a child of another, ie, it is part of a drop down menu. That value defaults to zero.

So when that line above ran in our install, it made sure that our component went into that table with the awkward ID# of 0. Since all base-level, ie non-child, components had their parent id set to 0, they were "recognized" as being child elements of our component.

So when we tried to uninstall our component, crazy things happened. All sub-menu elements of components are uninstalled when the component itself if. So in out case, anything with parent=0 in the #__components table was deleted. That's why the menu is blank and the components are loaded: because Joomla thinks there ARE no components TO load. The components table was, for all intensive purposes, empty.

To fix this, you can get rid of that line in your MySQL install file (assuming it's there), or manually change some things. You will need to change the ID# of your component from 0 to whatever you need (making sure to change the table's autoincrement if necessary). Then, all of the already installed components will no longer point to that ID#, which is no longer zero.
If you were unfortunate enough to have uninstalled during this time and this lost all other records in the #__components table, you will either need to manually re-insert them with phpMyAdmin or find a backup of that table."

I have to admit I would have worked a lot on this to figure it out, since I am lazy and I preferr to reinstal Joomla. Thanks to Adi Hada for pointing me to this forum post and to PresidentDunn for writting this.

You can find the entire post here: http://forum.joomla.org/viewtopic.php?p=1807574

คำสำคัญ (Tags): #joomla#ปัญหา#แก้ไข
หมายเลขบันทึก: 299975เขียนเมื่อ 23 กันยายน 2009 02:39 น. ()แก้ไขเมื่อ 23 มิถุนายน 2012 12:15 น. ()สัญญาอนุญาต: ครีเอทีฟคอมมอนส์แบบ แสดงที่มา-ไม่ใช้เพื่อการค้า-อนุญาตแบบเดียวกันจำนวนที่อ่านจำนวนที่อ่าน:


ความเห็น (0)

ไม่มีความเห็น

ไม่อนุญาตให้แสดงความเห็น
พบปัญหาการใช้งานกรุณาแจ้ง LINE ID @gotoknow
ClassStart
ระบบจัดการการเรียนการสอนผ่านอินเทอร์เน็ต
ทั้งเว็บทั้งแอปใช้งานฟรี
ClassStart Books
โครงการหนังสือจากคลาสสตาร์ท