No Code Attached Yet bug
avatar Ruud68
Ruud68
4 Nov 2022

Steps to reproduce the issue

to reproduce with a core component (com_contact)

On j3 site add the following function to ./components/com_contact/controllers/contact.php

public function test()
{
	var_dump($this->input->getArray());die;
}

On J4 site add the same method in ./components/com_contact/src/controller/ContactController.php

Now lets call this method on both the J3 and J4 site:

[J3domain]/index.php?option=com_contact&task=contact.test
[J4domain]/index.php?option=com_contact&task=contact.test

Actual result on J3 site

array(5) {
  ["option"]=>
  string(11) "com_contact"
  ["task"]=>
  string(4) "test"
  ["language"]=>
  string(5) "en-GB"
  ["Itemid"]=>
  NULL
  ["lang"]=>
  string(5) "en-GB"
}

Actual result on J4 site

array(7) {
  ["option"]=>
  string(11) "com_contact"
  ["task"]=>
  string(4) "test"
  ["language"]=>
  string(5) "en-GB"
  ["view"]=>
  string(7) "article"
  ["id"]=>
  string(1) "8"
  ["Itemid"]=>
  int(1142)
  ["controller"]=>
  string(7) "contact"
}

System information (as much as possible)

J3.10.11 and J4.2.4

Additional comments

Been troubleshooting this on several sites / extensions and found that this is (IMO) a B/C break.
I think this is due to J4 adding the Itemid without that being called for. In the example given here it adds Itemid 1142 (which is my frontpage, com_content). This is not the issue,: the issue is that it also adds the view and when not specified on the url the id.

So if the extension reads if the id is present ($this->input->get('id', '')) and acts upon it, then in J4 it will always act upon it: not in this case on the contact id, but on the article id (8). So the id is not for the contact but for the article leading to unwanted behavior.

avatar Ruud68 Ruud68 - open - 4 Nov 2022
avatar Ruud68 Ruud68 - change - 4 Nov 2022
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 4 Nov 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 4 Nov 2022
avatar wojtekxtx
wojtekxtx - comment - 7 Nov 2022

Dont have access to J3, but can confirm this on J4

avatar Hackwar Hackwar - change - 22 Feb 2023
Labels Added: bug
avatar Hackwar Hackwar - labeled - 22 Feb 2023
avatar Hackwar
Hackwar - comment - 14 Mar 2024

Can you check if #42989 solves this for you?

avatar Ruud68
Ruud68 - comment - 15 Mar 2024

I can't: not doing anything J3 related anymore as it is not supported. In my extensions I worked around this issue in the code.
I think your proposed solution will cause problems for extension devs: one dev telling the customer to turn it on, the other telling the customer to turn it off.

avatar Hackwar
Hackwar - comment - 26 Mar 2024

Can you check #43164 if that helps you?

avatar Hackwar Hackwar - change - 30 Mar 2024
Status New Closed
Closed_Date 0000-00-00 00:00:00 2024-03-30 16:06:07
Closed_By Hackwar
avatar Hackwar Hackwar - close - 30 Mar 2024
avatar Hackwar
Hackwar - comment - 30 Mar 2024

Since #43164 seems to fix this, I'm closing the issue.

Add a Comment

Login with GitHub to post a comment