Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Anlegen eines neuen MM und "Zurück"-Button OHNE Speichern => Error #946

Closed
zonky2 opened this issue Jan 6, 2016 · 26 comments
Closed
Assignees
Labels
backend This seems to be a bug in the backend bug A bug! A bug! Fast, squish it! DC_General This ticket originated from or is directly related to DCG testing This ticket is reported to be fixed by a developer and should be tested.
Milestone

Comments

@zonky2
Copy link
Contributor

zonky2 commented Jan 6, 2016

Klickt man auf "Neues MetaModel" und in der anschließend geöffneten Eingabemaske gleich wieder auf "Zurück", kommt folgende Fehlermeldung

MM core 2.0.0-alpha8

Fatal error: Uncaught exception Exception with message Query error: 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 '' at line 1 (SELECT count(*) AS itemCount FROM) thrown in C:\Contao2Go\htdocs\vhosts\contao-3.5.x\system\modules\core\library\Contao\Database\Statement.php on line 295

#0 C:\Contao2Go\htdocs\vhosts\contao-3.5.x\system\modules\core\library\Contao\Database\Statement.php(264): Contao\Database\Statement->query()
#1 C:\Contao2Go\htdocs\vhosts\contao-3.5.x\composer\vendor\metamodels\core\src\MetaModels\DcGeneral\Events\Table\MetaModels\Subscriber.php(182): Contao\Database\Statement->execute()
#2 [internal function]: MetaModels\DcGeneral\Events\Table\MetaModels\Subscriber->modelToLabel(Object(ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\Event\ModelToLabelEvent), 'dc-general.view...', Object(Symfony\Component\EventDispatcher\EventDispatcher))
#3 C:\Contao2Go\htdocs\vhosts\contao-3.5.x\composer\vendor\symfony\event-dispatcher\EventDispatcher.php(181): call_user_func(Array, Object(ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\Event\ModelToLabelEvent), 'dc-general.view...', Object(Symfony\Component\EventDispatcher\EventDispatcher))
#4 C:\Contao2Go\htdocs\vhosts\contao-3.5.x\composer\vendor\symfony\event-dispatcher\EventDispatcher.php(46): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'dc-general.view...', Object(ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\Event\ModelToLabelEvent))
#5 C:\Contao2Go\htdocs\vhosts\contao-3.5.x\composer\vendor\contao-community-alliance\dc-general\src\ContaoCommunityAlliance\DcGeneral\Contao\Subscriber\FormatModelLabelSubscriber.php(89): Symfony\Component\EventDispatcher\EventDispatcher->dispatch('dc-general.view...', Object(ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\Event\ModelToLabelEvent))
#6 [internal function]: ContaoCommunityAlliance\DcGeneral\Contao\Subscriber\FormatModelLabelSubscriber->handleFormatModelLabel(Object(ContaoCommunityAlliance\DcGeneral\Event\FormatModelLabelEvent), 'dc-general.mode...', Object(Symfony\Component\EventDispatcher\EventDispatcher))
#7 C:\Contao2Go\htdocs\vhosts\contao-3.5.x\composer\vendor\symfony\event-dispatcher\EventDispatcher.php(181): call_user_func(Array, Object(ContaoCommunityAlliance\DcGeneral\Event\FormatModelLabelEvent), 'dc-general.mode...', Object(Symfony\Component\EventDispatcher\EventDispatcher))
#8 C:\Contao2Go\htdocs\vhosts\contao-3.5.x\composer\vendor\symfony\event-dispatcher\EventDispatcher.php(46): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'dc-general.mode...', Object(ContaoCommunityAlliance\DcGeneral\Event\FormatModelLabelEvent))
#9 C:\Contao2Go\htdocs\vhosts\contao-3.5.x\composer\vendor\contao-community-alliance\dc-general\src\ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\ListView.php(242): Symfony\Component\EventDispatcher\EventDispatcher->dispatch('dc-general.mode...', Object(ContaoCommunityAlliance\DcGeneral\Event\FormatModelLabelEvent))
#10 C:\Contao2Go\htdocs\vhosts\contao-3.5.x\composer\vendor\contao-community-alliance\dc-general\src\ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\ListView.php(263): ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\ListView->setListViewLabel(Object(ContaoCommunityAlliance\DcGeneral\Data\DefaultCollection), Array)
#11 C:\Contao2Go\htdocs\vhosts\contao-3.5.x\composer\vendor\contao-community-alliance\dc-general\src\ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\ListView.php(330): ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\ListView->viewList(Object(ContaoCommunityAlliance\DcGeneral\Data\DefaultCollection))
#12 [internal function]: ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\ListView->showAll(Object(ContaoCommunityAlliance\DcGeneral\Action))
#13 C:\Contao2Go\htdocs\vhosts\contao-3.5.x\composer\vendor\contao-community-alliance\dc-general\src\ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\BaseView.php(149): call_user_func_array(Array, Array)
#14 [internal function]: ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\BaseView->handleAction(Object(ContaoCommunityAlliance\DcGeneral\Event\ActionEvent), 'dc-general.acti...', Object(Symfony\Component\EventDispatcher\EventDispatcher))
#15 C:\Contao2Go\htdocs\vhosts\contao-3.5.x\composer\vendor\symfony\event-dispatcher\EventDispatcher.php(181): call_user_func(Array, Object(ContaoCommunityAlliance\DcGeneral\Event\ActionEvent), 'dc-general.acti...', Object(Symfony\Component\EventDispatcher\EventDispatcher))
#16 C:\Contao2Go\htdocs\vhosts\contao-3.5.x\composer\vendor\symfony\event-dispatcher\EventDispatcher.php(46): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'dc-general.acti...', Object(ContaoCommunityAlliance\DcGeneral\Event\ActionEvent))
#17 C:\Contao2Go\htdocs\vhosts\contao-3.5.x\composer\vendor\contao-community-alliance\dc-general\src\ContaoCommunityAlliance\DcGeneral\Controller\DefaultController.php(131): Symfony\Component\EventDispatcher\EventDispatcher->dispatch('dc-general.acti...', Object(ContaoCommunityAlliance\DcGeneral\Event\ActionEvent))
#18 C:\Contao2Go\htdocs\vhosts\contao-3.5.x\composer\vendor\metamodels\core\src\MetaModels\BackendIntegration\Module.php(74): ContaoCommunityAlliance\DcGeneral\Controller\DefaultController->handle(Object(ContaoCommunityAlliance\DcGeneral\Action))
#19 C:\Contao2Go\htdocs\vhosts\contao-3.5.x\system\modules\core\classes\Backend.php(423): MetaModels\BackendIntegration\Module->generate()
#20 C:\Contao2Go\htdocs\vhosts\contao-3.5.x\system\modules\core\controllers\BackendMain.php(131): Contao\Backend->getBackendModule('metamodels')
#21 C:\Contao2Go\htdocs\vhosts\contao-3.5.x\contao\main.php(20): Contao\BackendMain->run()
#22 {main}

Workaround: in der Tabelle tl_metamodel per phpMyAdmin den (letzten) Eintrag löschen, der bei "name" und "tableName" keine Werte enthält

@zonky2 zonky2 changed the title Bug: Anlegen eines neuen MM und "Zurück"-Button Bug: Anlegen eines neuen MM und "Zurück"-Button => Error Jan 6, 2016
@zonky2 zonky2 added the bug A bug! A bug! Fast, squish it! label Jan 8, 2016
@zonky2 zonky2 added this to the 2.0.0 milestone Jan 8, 2016
@zonky2 zonky2 added the Up for discussion This ticket will be up for discussion in one of our next calls label Jan 12, 2016
@zonky2 zonky2 added backend This seems to be a bug in the backend and removed Up for discussion This ticket will be up for discussion in one of our next calls labels Jan 19, 2016
@zonky2 zonky2 changed the title Bug: Anlegen eines neuen MM und "Zurück"-Button => Error Bug: Anlegen eines neuen MM und "Zurück"-Button OHNE Speichern => Error Feb 10, 2016
@stefanheimes
Copy link
Member

Ich weiß was der Fehler ist, ich kann es aber nicht nachstellen. Ich lege ein MM an und gehe ohne ein Eingabe auf den Zurück-Button, aber es passiert nichts.

@zonky2
Copy link
Contributor Author

zonky2 commented Feb 11, 2016

@stefanheimes
Copy link
Member

Wie gesagt ich weiß wo der Fehler sitzt und auch warum, ich weiß nur nicht wie es überhaupt soweit kommen kann. Wenn ein leeres MM angelegt wird, also die Grundeinstellungen, ich nicht speicher und zurück gehe, hab ich auch keine Leiche in der DB. Das ist mein Hauptproblem. Ich weiß nicht wie ich diese Leiche in der Datenbank hinbekommen soll. Das System versucht alle MM Tabellen auszulesen, da es hier aber noch keinen Name gibt stirbt der SQL daran.

@zonky2
Copy link
Contributor Author

zonky2 commented Feb 11, 2016

wenn ich an der Stelle bin

shot97

wird bei mir in der DB schon ein Datensatz (tl_metamodel) angelegt

shot98

... wenn ich nichts speichere bzw. während des Zustandes in einem anderen Browser-Tab auf MM gehe, kommt der Fehler... die Fehlerursache ist ja soweit klar...

das Ganze ist m.E. ein generelles Problem und tritt z.B. auch bei Dateneingaben u.ä. auf (hier meist ohne Fehlermeldung) => sollte man beim Öffnen eines Panels schon einen (temporären) Datensatz anlegen oder nicht?

siehe auch #947

@discordier
Copy link
Member

Das ist es eben. Der Dc General legt eben normalerweise keinen Datensatz an. Deshalb koennen wir es auch nicht nachstellen.
Bei mir passiert wie bei Stefan auch nix.

@MacKP
Copy link
Contributor

MacKP commented Feb 12, 2016

Hmm ich kann das auch nachstellen: MM anlegen.. Formular nicht ausfüllen, sondern einfach zurück gehen. Fertig. Schon hab ich auch das Problem. Ich frage mich gerade wie ihr es nicht schafft das nachzustellen xD

@zonky2
Copy link
Contributor Author

zonky2 commented Feb 12, 2016

welchen DCG habt "Ihr", den "wir" nicht haben ;-)

@zonky2
Copy link
Contributor Author

zonky2 commented Feb 12, 2016

btw: ich habe das mit dem Verhalten vom Contao-Core verglichen: z.B. Seite anlegen: hat man die Eingabemaske für die Einstellungen einer neuen Seite, wird auch hier gleichzeitig ein DB-Eintrag angelegt - wir die Webseite geschlossen/Browser gekillt, ist der Eintrag in der DB wieder weg..!?? MySQL-Trigger?

@stefanheimes
Copy link
Member

Ich wandere zwischen letzter Version und den nächsten Version des DCG und MM her, ich werde das nochmal prüfen mit den alten und den neuen.

@discordier
Copy link
Member

@xantippe kann das zu? contao-community-alliance/dc-general#183 ist ja fixed

@zonky2
Copy link
Contributor Author

zonky2 commented Mar 2, 2016

muss ich nochmal testen

@zonky2
Copy link
Contributor Author

zonky2 commented Mar 3, 2016

nein - Bug noch da

DCG: dev-hotfix/2.0.0-beta34 (bb67abb3)

Fatal error: Uncaught exception Exception with message Query error: 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 '' at line 1 (SELECT count(*) AS itemCount FROM) thrown in C:\Contao2Go\htdocs\vhosts\contao-3.5.x\system\modules\core\library\Contao\Database\Statement.php on line 295

#0 C:\Contao2Go\htdocs\vhosts\contao-3.5.x\system\modules\core\library\Contao\Database\Statement.php(264): Contao\Database\Statement->query()
#1 C:\Contao2Go\htdocs\vhosts\contao-3.5.x\composer\vendor\metamodels\core\src\MetaModels\DcGeneral\Events\Table\MetaModels\Subscriber.php(182): Contao\Database\Statement->execute()
#2 [internal function]: MetaModels\DcGeneral\Events\Table\MetaModels\Subscriber->modelToLabel(Object(ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\Event\ModelToLabelEvent), 'dc-general.view...', Object(Symfony\Component\EventDispatcher\EventDispatcher))
#3 C:\Contao2Go\htdocs\vhosts\contao-3.5.x\composer\vendor\symfony\event-dispatcher\EventDispatcher.php(181): call_user_func(Array, Object(ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\Event\ModelToLabelEvent), 'dc-general.view...', Object(Symfony\Component\EventDispatcher\EventDispatcher))
#4 C:\Contao2Go\htdocs\vhosts\contao-3.5.x\composer\vendor\symfony\event-dispatcher\EventDispatcher.php(46): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'dc-general.view...', Object(ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\Event\ModelToLabelEvent))
#5 C:\Contao2Go\htdocs\vhosts\contao-3.5.x\composer\vendor\contao-community-alliance\dc-general\src\ContaoCommunityAlliance\DcGeneral\Contao\Subscriber\FormatModelLabelSubscriber.php(89): Symfony\Component\EventDispatcher\EventDispatcher->dispatch('dc-general.view...', Object(ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\Event\ModelToLabelEvent))
#6 [internal function]: ContaoCommunityAlliance\DcGeneral\Contao\Subscriber\FormatModelLabelSubscriber->handleFormatModelLabel(Object(ContaoCommunityAlliance\DcGeneral\Event\FormatModelLabelEvent), 'dc-general.mode...', Object(Symfony\Component\EventDispatcher\EventDispatcher))
#7 C:\Contao2Go\htdocs\vhosts\contao-3.5.x\composer\vendor\symfony\event-dispatcher\EventDispatcher.php(181): call_user_func(Array, Object(ContaoCommunityAlliance\DcGeneral\Event\FormatModelLabelEvent), 'dc-general.mode...', Object(Symfony\Component\EventDispatcher\EventDispatcher))
#8 C:\Contao2Go\htdocs\vhosts\contao-3.5.x\composer\vendor\symfony\event-dispatcher\EventDispatcher.php(46): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'dc-general.mode...', Object(ContaoCommunityAlliance\DcGeneral\Event\FormatModelLabelEvent))
#9 C:\Contao2Go\htdocs\vhosts\contao-3.5.x\composer\vendor\contao-community-alliance\dc-general\src\ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\ListView.php(243): Symfony\Component\EventDispatcher\EventDispatcher->dispatch('dc-general.mode...', Object(ContaoCommunityAlliance\DcGeneral\Event\FormatModelLabelEvent))
#10 C:\Contao2Go\htdocs\vhosts\contao-3.5.x\composer\vendor\contao-community-alliance\dc-general\src\ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\ListView.php(264): ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\ListView->setListViewLabel(Object(ContaoCommunityAlliance\DcGeneral\Data\DefaultCollection), Array)
#11 C:\Contao2Go\htdocs\vhosts\contao-3.5.x\composer\vendor\contao-community-alliance\dc-general\src\ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\ListView.php(324): ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\ListView->viewList(Object(ContaoCommunityAlliance\DcGeneral\Data\DefaultCollection))
#12 [internal function]: ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\ListView->showAll(Object(ContaoCommunityAlliance\DcGeneral\Action))
#13 C:\Contao2Go\htdocs\vhosts\contao-3.5.x\composer\vendor\contao-community-alliance\dc-general\src\ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\BaseView.php(141): call_user_func_array(Array, Array)
#14 [internal function]: ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\BaseView->handleAction(Object(ContaoCommunityAlliance\DcGeneral\Event\ActionEvent), 'dc-general.acti...', Object(Symfony\Component\EventDispatcher\EventDispatcher))
#15 C:\Contao2Go\htdocs\vhosts\contao-3.5.x\composer\vendor\symfony\event-dispatcher\EventDispatcher.php(181): call_user_func(Array, Object(ContaoCommunityAlliance\DcGeneral\Event\ActionEvent), 'dc-general.acti...', Object(Symfony\Component\EventDispatcher\EventDispatcher))
#16 C:\Contao2Go\htdocs\vhosts\contao-3.5.x\composer\vendor\symfony\event-dispatcher\EventDispatcher.php(46): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'dc-general.acti...', Object(ContaoCommunityAlliance\DcGeneral\Event\ActionEvent))
#17 C:\Contao2Go\htdocs\vhosts\contao-3.5.x\composer\vendor\contao-community-alliance\dc-general\src\ContaoCommunityAlliance\DcGeneral\Controller\DefaultController.php(130): Symfony\Component\EventDispatcher\EventDispatcher->dispatch('dc-general.acti...', Object(ContaoCommunityAlliance\DcGeneral\Event\ActionEvent))
#18 C:\Contao2Go\htdocs\vhosts\contao-3.5.x\composer\vendor\metamodels\core\src\MetaModels\BackendIntegration\Module.php(74): ContaoCommunityAlliance\DcGeneral\Controller\DefaultController->handle(Object(ContaoCommunityAlliance\DcGeneral\Action))
#19 C:\Contao2Go\htdocs\vhosts\contao-3.5.x\system\modules\core\classes\Backend.php(423): MetaModels\BackendIntegration\Module->generate()
#20 C:\Contao2Go\htdocs\vhosts\contao-3.5.x\system\modules\core\controllers\BackendMain.php(131): Contao\Backend->getBackendModule('metamodels')
#21 C:\Contao2Go\htdocs\vhosts\contao-3.5.x\contao\main.php(20): Contao\BackendMain->run()
#22 {main}

@zonky2 zonky2 added the DC_General This ticket originated from or is directly related to DCG label Mar 25, 2016
@zonky2
Copy link
Contributor Author

zonky2 commented Mar 26, 2016

@baumannsven
Copy link
Member

@discordier um diese Sache kümmere ich mich

@AgentCT
Copy link

AgentCT commented Jul 2, 2016

ich habe das gleiche Problem und ich komme garnicht in Metamodels.
Gibt es eine Lösung wie ich es wieder zum Laufen bekommen?

Ergänzung:
Es wird definitiv in der DB ein Eintrag angelegt, der Leer ist. Löscht man diesen manuell funktioniert MM wieder fehlerfrei.

@zonky2
Copy link
Contributor Author

zonky2 commented Jul 2, 2016

per phpMyAdmin tl_metamodels bearbeiten bzw. entsprechende Zeile löschen

@discordier discordier added the testing This ticket is reported to be fixed by a developer and should be tested. label Aug 4, 2016
@discordier
Copy link
Member

Should be fixed with DCG beta37

@cliffparnitzky
Copy link
Contributor

Testing this with dev-hotfix/beta-37 (4a353578) is not possible due to errors.

@discordier
Copy link
Member

could you enlighten me what errors those are?

@cliffparnitzky
Copy link
Contributor

image

This is what i get when using the current commit of https://github.com/contao-community-alliance/dc-general/tree/hotfix/beta-37.

@discordier
Copy link
Member

@cliffparnitzky, @stefanheimes could you have another look at this?
would be in need of a proper stack trace.

However, I am on Festival right now and therefore can not check myself.

@cliffparnitzky
Copy link
Contributor

The probleme is located here: https://github.com/contao-community-alliance/dc-general/blob/master/src/ContaoCommunityAlliance/DcGeneral/View/ActionHandler/AbstractHandler.php#L145

The method is called from the PasteHandler with create. At this point $this->getEvent() returns null. This causes the error. But what shuould happen? @stefanheimes Any idea?

@zonky2
Copy link
Contributor Author

zonky2 commented Aug 14, 2016

Hi @cliffparnitzky - have you a workaround? I think, @stefanheimes is "afk" for this week...

@cliffparnitzky
Copy link
Contributor

No, sorry, i have currently no solution. I've tested a little bit, but nothing worked. Maybe @discordier could give me a little hint, what to do there?

@discordier
Copy link
Member

Follow up to contao-community-alliance/dc-general#290

@cliffparnitzky
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend This seems to be a bug in the backend bug A bug! A bug! Fast, squish it! DC_General This ticket originated from or is directly related to DCG testing This ticket is reported to be fixed by a developer and should be tested.
Projects
None yet
Development

No branches or pull requests

7 participants