create a SEF url with Route::_ like this:
Route::_('index.php?option=com_example&task=payment.response&processor=paylater&order=1234567890&test1=123&test2=456', true, Route::TLS_IGNORE, true)`
the router builds the following URL:
[yourdomain]/nl/sub/payment-page/payment/response?processor=paylater&order=1234567890&test1=123&test2=456
now in the site controller for com_example do a var_dump for: \Jooma\Input\Input
The extra query parameters (order, test1, test2) should be part of the data (retrievable with getString)
Joomla 3: this works okay as the following data is in Input:
protected 'data' =>
array (size=12)
'processor' => string 'paylater' (length=8)
'amp;order' => string '1234567890' (length=10)
'amp;test1' => string '123' (length=3)
'amp;test2' => string '456' (length=3)
'language' => string 'nl-NL' (length=5)
'order' => string '1234567890' (length=10)
'test1' => string '123' (length=3)
'test2' => string '456' (length=3)
'Itemid' => string '4490' (length=4)
'option' => string 'com_example' (length=20)
'task' => string 'payment.response' (length=16)
'lang' => string 'nl-NL' (length=5)
On Joomla 4 however this will fail as the data is not fully stored / converted, as you can see below only the (e.g. 'amp;order' is stored and not 'order' so trying to getString('order') will fail
protected 'data' =>
array (size=4)
'processor' => string 'paylater' (length=8)
'amp;order' => string '1234567890' (length=10)
'amp;test1' => string '123' (length=3)
'amp;test2' => string '456' (length=3)
workaround (or better solution) is not to use \Joomla\Input\Input but Factory::getApplcation()->input as this works correct in both Joomla 3 and Joomla 4
Thanks for the followup :)
I have search documentation and especially the BC document but couldn't find any reference to this difference in J3 / J4
In order to avoid time loss / 'frustration' / debugging why things are not working as expected this should at least be documented.
That is why I took the time to report, already started to change (and test everything all over again) for my own extensions :)
And is in J4 the $_REQUEST by design or should it be &$_REQUEST like it is in J3?
I cannot say, I do not know.
I suspect it is by design, but better to ask someone who know :)
It's expected but need documentation @wilsonge ?
Reference https://groups.google.com/g/joomla-dev-framework/c/ngYzAqZMnSY
Thanks @HLeithner for digging this up. Should definitely be documented as it is (imo) a b/c break. My experience is that when it happens to me, it will for sure happen to others to :)
Yeah I think this is expected. We can definitely add it to the b/c breaks page
Labels |
Added:
?
|
Labels |
Added:
No Code Attached Yet
Documentation Required
bug
Removed: ? ? |
here is the page to document it https://docs.joomla.org/index.php?title=Potential_backward_compatibility_issues_in_Joomla_4/en&action=edit
Sadly I'm not allowed to edit it @wilsonge
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2024-04-02 12:51:23 |
Closed_By | ⇒ | Hackwar |
I documented the change on the given page. Closing this issue.
I not fully understood what exactly you dumping, and how it related to
Route::_()
but yes, you should always use
$app->input
In Joomla 3
Input::$data
is reference to$_REQUEST
, so the changes applies in both ways:joomla-cms/libraries/vendor/joomla/input/src/Input.php
Lines 112 to 115 in 9cb87ee
in Joomla 4
Input::$data
is copy of$_REQUEST
:https://github.com/joomla-framework/input/blob/bba837434b13a0d5cb495bb6eeee3547da306f8e/src/Input.php#L93-L98