[TYPO3-german] Schwierigkeiten bei Belegung Select-Feld aus Tabelle
Michael.Hafner at dw-world.de
Michael.Hafner at dw-world.de
Fri Jan 2 12:27:55 CET 2009
Salut,
ich versuche in einer Extension, ein Select-Feld in einem BE-Formular mit
Werten aus einer Tabelle ("tx_abdtopicdb_topic_type") zu füllen.
TCA:
"topictype" => Array (
"config" => Array (
"type" => "select",
"items" => Array (
Array ("", 0),
),
"foreign_table" => "tx_abdtopicdb_topic_type",
"foreign_table_where" => "AND tx_abdtopicdb_topic_type.pid=0 order by
tx_abdtopicdb_topic_type.name",
)
),
Die Tabelle `tx_abdtopicdb_topic_type` gibt es...
CREATE TABLE tx_abdtopicdb_topic_type (
uid int(11) NOT NULL auto_increment,
pid int(11) DEFAULT '0' NOT NULL,
name tinytext NOT NULL,
PRIMARY KEY (uid),
KEY parent (pid)
);
..., sie ist auch in TCA definiert; trotzdem erhalte ich beim
Formularaufruf im BE:
You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near 'FROM
tx_abdtopicdb_topic_type,pages WHERE pages.uid=tx_abdtopicdb_topic_t' at
line 2
lastBuildQuery:
SELECT tx_abdtopicdb_topic_type.uid,tx_abdtopicdb_topic_type.
FROM tx_abdtopicdb_topic_type,pages
WHERE
pages.uid=tx_abdtopicdb_topic_type.pid
AND pages.deleted=0 AND 1=1 AND tx_abdtopicdb_topic_type.pid=0
ORDER BY tx_abdtopicdb_topic_type.name
Was mir hier auffällt ist, dass nach dem Punkt hinter
tx_abdtopicdb_topic_type keine Feldauswahl/ kein Sternchen folgt. Nun baut
diesen Teil der Query aber Typo3 selbst; in "foreign_table_where" kann ich
ja nur den WHERE-Teil des SQL-Statements angeben - also nicht die fehlende
Feldliste oder ein Sternchen.
Wenn ich die Query kopiere, das Sternchen ergänze und sie in PhpMyAdmin
laufen lasse, ergibt das zwar ein leeres Resultat, aber keinen Fehler.
(Das wäre Frage 2: Wozu baut Typo3 immer ein join auf "pages" ein?)
Anfängerfehler?
Herzlichen Gruß!
M.C.
More information about the TYPO3-german
mailing list