Hallo,
ich möchte eine Extension schreiben mit Dates und States.
Zu jedem Date soll es ein State geben.
Mein Problem ist im Backend diese Fehlermeldung:
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in ...
Meine ext_tables.sql:
#
# Table structure for table 'tx_xinfo_dates'
#
CREATE TABLE tx_xinfo_dates (
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,
l18n_parent int(11) DEFAULT '0' NOT NULL,
l18n_diffsource mediumblob NOT NULL,
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 varchar(100) DEFAULT '' NOT NULL,
projects blob NOT NULL,
title varchar(40) DEFAULT '' NOT NULL,
description text NOT NULL,
date_start int(11) DEFAULT '0' NOT NULL,
date_end int(11) DEFAULT '0' NOT NULL,
state int(11) DEFAULT '0' NOT NULL,
date_start_other int(11) DEFAULT '0' NOT NULL,
date_end_other int(11) DEFAULT '0' NOT NULL,
state_other int(11) DEFAULT '0' NOT NULL,
PRIMARY KEY (uid),
KEY parent (pid)
);
#
# Table structure for table 'tx_xinfo_dates_datestates_rel'
#
CREATE TABLE tx_xinfo_dates_datestates_rel (
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,
deleted tinyint(4) DEFAULT '0' NOT NULL,
hidden tinyint(4) DEFAULT '0' NOT NULL,
date_id int(11) DEFAULT '0' NOT NULL,
dstate_id int(11) DEFAULT '0' NOT NULL,
PRIMARY KEY (uid),
KEY parent (pid)
);
#
# Table structure for table 'tx_xinfo_datestates'
#
CREATE TABLE tx_xinfo_datestates (
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,
l18n_parent int(11) DEFAULT '0' NOT NULL,
l18n_diffsource mediumblob NOT NULL,
deleted tinyint(4) DEFAULT '0' NOT NULL,
hidden tinyint(4) DEFAULT '0' NOT NULL,
title varchar(40) DEFAULT '' NOT NULL,
PRIMARY KEY (uid),
KEY parent (pid)
);
Meine TCA:
$TCA["tx_xinfo_dates"] = array (
"ctrl" => $TCA["tx_xinfo_dates"]["ctrl"],
"interface" => array (
"showRecordFieldList" => "sys_language_uid,l18n_parent,l18n_diffsource,hidden,starttime,endtime,fe_group,projects,title,description,date_start,date_end,state,date_start_other,date_end_other,state_other"
),
"feInterface" => $TCA["tx_xinfo_dates"]["feInterface"],
"columns" => array (
...
"state" => Array (
"exclude" => 1,
"label" => "LLL:EXT:x_info/locallang_db.xml:tx_xinfo_dates.state",
"config" => Array (
"type" => "inline",
"foreign_table" => "tx_xinfo_dates_datestates_rel",
"foreign_field" => "date_id",
"foreign_selector" => "dstate_id",
"maxitems" => 1,
"appearance" => array(
'useCombination' => 1,
)
)
),
...
);
$TCA["tx_xinfo_dates_datestates_rel"] = array (
"ctrl" => $TCA["tx_xinfo_dates_datestates_rel"]["ctrl"],
"interface" => array (
"showRecordFieldList" => "hidden,date_id,dstate_id"
),
"feInterface" => $TCA["tx_xinfo_dates_datestates_rel"]["feInterface"],
"columns" => array (
...
"date_id" => Array (
"exclude" => 1,
"label" => "LLL:EXT:x_info/locallang_db.xml:tx_xinfo_dates_datestates_rel.date_id",
"config" => Array (
"type" => "select",
"foreign_table" => "tx_xinfo_dates",
"maxitems" => 1,
)
),
"dstate_id" => Array (
"exclude" => 0,
"label" => "LLL:EXT:x_info/locallang_db.xml:tx_xinfo_dates_datestates_rel.dstate_id",
"config" => Array (
"type" => "select",
"foreign_table" => "tx_xinfo_datestates",
"maxitems" => 1,
)
),
),
...
);
$TCA["tx_xinfo_datestates"] = array (
"ctrl" => $TCA["tx_xinfo_datestates"]["ctrl"],
"interface" => array (
"showRecordFieldList" => "sys_language_uid,l18n_parent,l18n_diffsource,hidden,title,dates"
),
"feInterface" => $TCA["tx_xinfo_datestates"]["feInterface"],
"columns" => array (
...
"dates" => Array (
"exclude" => 0,
"label" => "LLL:EXT:x_info/locallang_db.xml:tx_xinfo_datestates.dates",
"config" => Array (
"type" => "inline",
"foreign_table" => "tx_xinfo_dates_datestates_rel",
"foreign_field" => "dstate_id",
"foreign_selector" => "date_id",
"maxitems" => 1,
"appearance" => array(
'useCombination' => 1,
)
)
),
),
...
);
Im Backend wird nur die Überschrift von states angezeigt und eben die Fehlermeldung.
Wenn ich es so mache (ohne Zwischetabelle) ...
"state" => Array (
"exclude" => 1,
"label" => "LLL:EXT:x_info/locallang_db.xml:tx_xinfo_dates.state",
"config" => Array (
"type" => "inline",
"foreign_table" => "tx_xinfo_datestates",
"foreign_field" => "uid",
"foreign_selector" => "uid",
"maxitems" => 1,
"appearance" => array(
'useCombination' => 1,
)
)
),
... dann wird der Link "Neu anlegen" angezeigt und auch die Fehlermeldung.
Wer kann mir weiterhelfen?
Trotz mehrerer Dokus finde ich nicht den richtigen Weg. #angry#
Vielen Dank
Frank