Joomla 5 Notice

We are pleased to announce that as of January 29, 2024, all of our Joomla extensions are compatible with Joomla 5.

For all who are still updateing from Joomla 3 to Joomla 4: Joomla 4 Migration instructions are available here:

There is now a separate Documentation for Visforms for Joomla 4 and for Visforms for Joomla 5!

Forum

Visforms Subscription user can ask questions in our forum. Please log in with the relevant user first.
Everybody can access the forum for reading.

Please only ask 1 question per topic.

Trigger für Edit-Benutzermail und Edit-Ergebnismail [gelöst]

More
1 month 1 week ago #10219 by Administrator IV
Replied by Administrator IV on topic Trigger für Edit-Benutzermail und Edit-Ergebnismail
Hallo Heinz,

richtig gute IDEs kosten immer Geld.
Die besten IDEs sind für mich die von JetBrains (Java, PHP, Python), ohne jede Frage.
Allerdings musste ich erst eine Zeit damit arbeiten, um zu erleben, was da alles Unfassbares geht!

Zum Thema Debugging: Debugging kommt immer durch eine IDE.

Die 23 besten PHP Editors und IDEs (Gratis und Premium):
kinsta.com/de/blog/php-editor/

Meine Empfehlung, weil sehr viel genutzt (auch für Java) und durch die Bank sehr gut befunden:
1. Visual Studio Code:
kinsta.com/de/blog/php-editor/#1-visual-studio-code

Liebe Grüße, Ingmar

:idea: I recommend you the new and up-to-date documentation for Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/en/docs/
Most of this also applies retrospectively to Joomla 3.
Please only ask 1 question per topic :-).

:idea: Ich empfehle Dir die neue und aktuelle Dokumentation für Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/docs/
Das meiste gilt rückwirkend auch für Joomla 3.
Bitte immer nur 1 Frage pro Thema stellen :-).
The following user(s) said Thank You: MaliRaj

More
1 month 1 week ago - 1 month 1 week ago #10222 by MaliRaj
Code:
if ($form->context != "vfedit{$form->id}") {     // Script nur in Edit-Mail ausführen     return; }
Danke Ingmar, das habe ich auch so verstanden und genau diese Stelle korrigiert.

Freundliche Grüße aus PM
Heinz
Last edit: 1 month 1 week ago by MaliRaj.

More
1 month 1 week ago #10223 by MaliRaj

 Meine Empfehlung, weil sehr viel genutzt (auch für Java) und durch die Bank sehr gut befunden:
1. Visual Studio Code:
kinsta.com/de/blog/php-editor/#1-visual-studio-code

Das ist ja ein toller Tipp, arbeite sonst nur "per Hand" mit Notepad++, hatte auch schon mal Rapid PHP probiert, will mich aber nun unbedingt in VS Code einarbeiten. Herzlichen Dank. Toller Service.

Freundliche Grüße aus PM
Heinz

More
4 weeks 2 days ago #10252 by MaliRaj
Hallo Ingmar, nachdem ich mich nun etwas eingelesen und eingearbeitet habe, komme ich mit XAMPP, VS Code, und XDebug ganz gut zurecht. Das erleichtert das Debuggen ja enorm. So konnte ich den Fehler auch gut finden und beheben. Folgenden Code benutze ich, um für alle meine Formulare separate Script-Dateien nutzen zu können:
Code:
public function onVisformsEmailPrepare($context, $mail, $form): bool { // triggered in VisformsModel after the mail object is instantiated and directly before the mail is sent: // can be used to modify the mail object: mail object is instantiated and all properties are set and can be modified // Skip plugin if context is wrong (bei Benutzer- & Ergebnis-Mail) if (($context != 'com_visforms.form.receiptmail') && ($context != 'com_visforms.form.resultmail')) { return true; } $app = Factory::getApplication(); // only perform action, if we are in front end if ($app->isClient('administrator')) { return true; } $file = __DIR__.'\\Helper\\'.__FUNCTION__.'_'.$form->id.'.php'; if (file_exists($file)) include_once($file); return true; }

Meine Scripte liegen im Ordner /Helper und sind nach den jeweiligen Visforms-Events benannt, denen die Formular_ID angehängt ist. Das funktioniert für alle Events übersichtlich und gut, außer bei onVisformsEmailPrepare und onVisformsBeforeEmailPrepare, die ja 2x aufgerufen werden. Das hatte ich nicht bedacht. Die kleine Änderung von include_once in include brachte dann das gewünschte Verhalten. Mit VS Code konnte ich gut erkennen, wo mein Script "falsch abbog".
Fazit: Debuggen kann auch Spaß machen 
Vielen Dank für die wertvolle Hilfe

Freundliche Grüße aus PM
Heinz

More
3 weeks 1 day ago #10288 by Administrator IV
Hallo Heinz,

Zu: Debuggen kann auch Spaß machen:

Genau, das wird dann manchmal richtig spannend ...

Und in manchen Situationen ist dann doch das umfangreiche Datei-Logging, etwa mit einem Logging-Profiler, notwendig.
Weil etwa die Code-Stelle nur selten aufgerufen wird und es nicht klar ist, unter welchen Voraussetzungen.

Zu: include_once($file);

Coole Idee, die andere auch hatten und sie dann allgemein 'Dispatcher' oder 'Plugin-Loder' oder 'Object-Loader' nennen.
In deinem Fall basiert es im Detail auf 'Convention over Configuration':
- Wenn die Datei nur richtig benannt wird (convention), wird sich automatisch verwendet.
- Es muss für eine neue Datei keine weitere Änderung (Configuration) vorgenommen werden.

Liebe Grüße und viel Spaß noch, Ingmar

:idea: I recommend you the new and up-to-date documentation for Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/en/docs/
Most of this also applies retrospectively to Joomla 3.
Please only ask 1 question per topic :-).

:idea: Ich empfehle Dir die neue und aktuelle Dokumentation für Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/docs/
Das meiste gilt rückwirkend auch für Joomla 3.
Bitte immer nur 1 Frage pro Thema stellen :-).
The following user(s) said Thank You: MaliRaj

Moderators: Administrator AVAdministrator IV
Powered by Kunena Forum