Octopoos / SEBLOD

Build high-end websites with SEBLOD®, a CCK for Joomla!
https://www.seblod.com
GNU General Public License v2.0
129 stars 55 forks source link

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

Open Giuse69 opened 1 year ago

Giuse69 commented 1 year ago

Free content types should support any table name, but Seblod code in some place assumes that the free table is named "#_cck_store_form" 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_storeform'.$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 . '"');