Joomla 5 Notice

We are pleased to announce that as of October 14, 2025, all of our Joomla extensions are compatible with Joomla 6.

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

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

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.

Important information for almost every question:
V1: Which Visforms version is running?
V2: Which Joomla version is running?
V3: Which PHP version is running?

Codebeispiel in der Doku erzeugt Fehler

More
2 years 6 months ago - 2 years 6 months ago #9125 by MaliRaj
Nur eine Info für die Aktualisierung der Dokumentation:
der Beispielcode1, konkret der redirect-Aufruf, unter
docs.joomla-4.visforms.vi-solutions.de/d...-benutzer-verhindern
Code:
$user = JFactory::getUser(); if (!$user->id) { $message = 'Please log in first'; $app = JFactory::getApplication(); $input = $app->input; $return = $input->post->get('return', null, 'cmd'); $url = (!empty($return)) ? base64_decode(strtr($return, '-_,', '+/=')) : 'index.php'; ==>  $app->redirect(JRoute::_($url, false), $message, 'warning');  <== $app->close(); }
erzeugt bei mir den Fehler: "You have not supplied a valid HTTP status code"

Abhilfe schaffte bei mir die da Aufteilung in zwei einzelne Befehlszeilen, wie ich sie auch in anderen Custom Plugin Stellen nutze:
Code:
$app->enqueueMessage($message, 'warning'); $app->redirect(JRoute::_($url, false));

Vielleicht hilft es jemandem mit gleichem Fehler.

Freundliche Grüße aus PM
Heinz
(Joomla 5.2.3 / Visforms+Subscription 5.4.1 / PHP 8.2)
Last edit: 2 years 6 months ago by Administrator IV.

More
2 years 6 months ago #9129 by Administrator IV
Replied by Administrator IV on topic Codebeispiel in der Doku erzeugt Fehler
Hallo Heinz,

das Code-Beispiel ist an dieser Stelle tatsächlich und ziemlich grob falsch.
Der Fehler ist laut Signatur der Funktion erwartbar:
Code:
* @param   string   $url     The URL to redirect to. Can only be http/https URL * @param   integer  $status  The HTTP 1.1 status code to be provided. 303 is assumed by default. \Joomla\CMS\Application\CMSApplication::redirect($url, $status = 303)
Vielen herzlichen Dank für deine Korrektur.
Die Dokumentation habe ich gerade angepasst.

Beispiel-Code 1: Submit durch nicht angemeldete Benutzer verhindern:
docs.joomla-4.visforms.vi-solutions.de/d...-benutzer-verhindern

Liebe Grüße, Ingmar

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

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

Moderators: Administrator AVAdministrator IV
Powered by Kunena Forum