Hallo zusammen,
ich habe heute verzweifelt versucht mittels der TCA Dokumentation, der IRRE Tutorials und der IRRE Tutorial Extension eine inline Relation mit foreign selector in meine eigene Extension (EXTBASE & FLUID) einzubauen.
Ich scheitere aber leider kurz vor dem Ziel.
In einem Projektdatensatz meiner Extension sollen bei mir Videos zugeordnet und direkt bearbeitet werden können ohne dass die Seite neu geladen werden muss (inline).
Im Backend wird die Relation korrekt dargestellt.
Dh. ich habe eine Selectbox in der alle verfügbaren Videos angezeigt werden mit dem Button "Relation hinzufügen".
Darunter werden dann die manuell hinzugefügten oder aber selbst neu erzeugten Videos angezeigt.
Ich kann diese sortieren und bearbeiten.
Beim Speichern erhalte ich aber eine SQL Fehlermeldung, die ich nicht nachvollziehen kann, da ich "pid" nirgends definiert haben:
2: SQL error: 'Unknown column 'pid' in 'field list'' (tx_dfkiprojects_project_video_mm:NEW4fe87a9b240a4)
Hier mein Datenbank Konfiguration (vereinfacht):
#
# Table structure for table 'tx_dfkiprojects_domain_model_project'
#
CREATE TABLE tx_dfkiprojects_domain_model_project (
uid int(11) NOT NULL auto_increment,
pid int(11) DEFAULT '0' NOT NULL,
title_short varchar(255) DEFAULT '' NOT NULL,
video int(11) unsigned DEFAULT '0' NOT NULL,
tstamp int(11) unsigned DEFAULT '0' NOT NULL,
crdate int(11) unsigned DEFAULT '0' NOT NULL,
cruser_id int(11) unsigned DEFAULT '0' NOT NULL,
deleted tinyint(4) unsigned DEFAULT '0' NOT NULL,
hidden tinyint(4) unsigned DEFAULT '0' NOT NULL,
starttime int(11) unsigned DEFAULT '0' NOT NULL,
endtime int(11) unsigned DEFAULT '0' NOT NULL,
t3ver_oid int(11) DEFAULT '0' NOT NULL,
t3ver_id int(11) DEFAULT '0' NOT NULL,
t3ver_wsid int(11) DEFAULT '0' NOT NULL,
t3ver_label varchar(255) DEFAULT '' NOT NULL,
t3ver_state tinyint(4) DEFAULT '0' NOT NULL,
t3ver_stage int(11) DEFAULT '0' NOT NULL,
t3ver_count int(11) DEFAULT '0' NOT NULL,
t3ver_tstamp int(11) DEFAULT '0' NOT NULL,
t3ver_move_id int(11) DEFAULT '0' NOT NULL,
t3_origuid int(11) DEFAULT '0' NOT NULL,
sys_language_uid int(11) DEFAULT '0' NOT NULL,
l10n_parent int(11) DEFAULT '0' NOT NULL,
l10n_diffsource mediumblob,
PRIMARY KEY (uid),
KEY parent (pid),
KEY t3ver_oid (t3ver_oid,t3ver_wsid),
KEY language (l10n_parent,sys_language_uid)
);
#
# Table structure for table 'tx_dfkiprojects_project_video_mm'
#
CREATE TABLE tx_dfkiprojects_project_video_mm (
uid_local int(11) unsigned DEFAULT '0' NOT NULL,
uid_foreign int(11) unsigned DEFAULT '0' NOT NULL,
sorting int(11) unsigned DEFAULT '0' NOT NULL,
sorting_foreign int(11) unsigned DEFAULT '0' NOT NULL,
KEY uid_local (uid_local),
KEY uid_foreign (uid_foreign)
);
#
# Table structure for table 'tx_html5videoplayer_domain_model_video'
#
CREATE TABLE tx_html5videoplayer_domain_model_video (
uid int(11) NOT NULL auto_increment,
pid int(11) DEFAULT '0' NOT NULL,
tstamp int(11) DEFAULT '0' NOT NULL,
crdate int(11) DEFAULT '0' NOT NULL,
cruser_id int(11) DEFAULT '0' NOT NULL,
sys_language_uid int(11) DEFAULT '0' NOT NULL,
l10n_parent int(11) DEFAULT '0' NOT NULL,
l10n_diffsource mediumtext,
sorting int(10) DEFAULT '0' NOT NULL,
deleted tinyint(4) DEFAULT '0' NOT NULL,
hidden tinyint(4) DEFAULT '0' NOT NULL,
starttime int(11) DEFAULT '0' NOT NULL,
endtime int(11) DEFAULT '0' NOT NULL,
fe_group int(11) DEFAULT '0' NOT NULL,
title tinytext,
description text,
ttcontent text,
posterimage tinytext,
mp4source tinytext,
webmsource tinytext,
oggsource tinytext,
height tinytext,
width tinytext,
downloadlinks tinyint(3) DEFAULT '0' NOT NULL,
supportvideojs tinyint(3) DEFAULT '0' NOT NULL,
preloadvideo tinytext,
autoplayvideo tinyint(3) DEFAULT '0' NOT NULL,
controlsvideo tinyint(3) DEFAULT '0' NOT NULL,
PRIMARY KEY (uid),
KEY parent (pid)
);
Hier mein TCA Konfiguration (vereinfacht):
/* TCA column of the local database where I want to add some existing Videos
* with the help of an inline relation
*/
'video' => array(
'exclude' => 0,
'label' => 'blubb',
'config' => array(
'type' => 'inline',
'foreign_table' => 'tx_dfkiprojects_project_video_mm',
'foreign_field' => 'uid_local',
'foreign_selector' => 'uid_foreign',
'foreign_unique' => 'uid_foreign',
'foreign_label' => 'uid_foreign',
'foreign_sortby' => 'sorting',
'size' => 5,
'maxitems' => 99,
'appearance' => array(
'collapseAll' => TRUE,
'expandSingle' => TRUE,
'useCombination' => 1,
'showPossibleRecordsSelector' => TRUE,
),
),
),
/* TCA of the m:n relation with select fields */
$TCA['tx_dfkiprojects_project_video_mm'] = array(
'ctrl' => $TCA['tx_dfkiprojects_project_video_mm']['ctrl'],
'interface' => array(
'showRecordFieldList' => 'uid_local, uid_foreign',
),
'types' => array(
'1' => array('showitem' => 'uid_local, uid_foreign'),
),
'palettes' => array(
'1' => array('showitem' => ''),
),
'columns' => array(
'uid_local' => array(
'label' => 'blubb local',
'config' => array(
'type' => 'select',
'maxitems' => 1,
'foreign_table' => 'tx_dfkiprojects_domain_model_project',
),
),
'uid_foreign' => array(
'label' => 'blubb Foreign',
'config' => array(
'type' => 'select',
'maxitems' => 1,
'foreign_table' => 'tx_html5videoplayer_domain_model_video',
),
),
'sorting' => array(
'config' => array(
'type' => 'passthrough',
),
),
'sorting_foreign' => array(
'config' => array(
'type' => 'passthrough',
),
),
),
);
Kann mir jm. weiterhelfen? Ich finde den Fehler einfach nicht und würde ungern auf eine einfache select Zuordnung übergehen. (Diese funktioniert übrigens einwandfrei)