Octopoos / SEBLOD

Build high-end websites with SEBLOD®, a CCK for Joomla!

Home Page:https://www.seblod.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

List of available fields not working in free child content type with generic parent table name

Giuse69 opened this issue · comments

Free content types should support any table name, but Seblod code in some place assumes that the free table is named "#_cck_store_form<content_type>" that is the default/standard name.
Now where a content type is a child content type of a parent content type of type free, Seblod breaks when trying to retrive the list of available fields in admin when editing a content type.
That's why in "administrator/components/com_cck/views/type/view.raw.php" in line 209 there is
$names = JCckDatabase::loadColumn( 'SELECT a.name FROM #__cck_core_fields AS a WHERE a.storage_table = "#_cck_store_form'.$this->item->parent.'"' );
but the list of names of fields of the parent content type is not retrieved with that query if the table name of parent content type is not standard (the empty field then throws a critical error since some lines later the full query for retrieving the fields becomes
...OR (a.name IN (Array)))... that is a SQL syntax error.
A possible fix might be
$names = JCckDatabase::loadColumn( 'SELECT a.name FROM #__cck_core_fields AS a WHERE a.storage_cck = "' . $this->item->parent . '"');