No Code Attached Yet bug
avatar prtuson
prtuson
17 Mar 2022

Steps to reproduce the issue

When creating a JsonApi view using the MVCFactory an error is produced if the optional options are not completed with a contentType.

Expected result

No error should be raised.

Actual result

An error is raised and the processing stops.

System information (as much as possible)

The constructor code in JsonApiView (within the MVC Library) is:
if (\array_key_exists('contentType', $config)) {
$this->type = $config['contentType'];
}
if ($this->serializer === null) {
$this->serializer = new JoomlaSerializer($this->type);
}

Additional comments

It should be:
if (\array_key_exists('contentType', $config)) {
$this->type = $config['contentType'];
if ($this->serializer === null) {
$this->serializer = new JoomlaSerializer($this->type);
}
}

So that the serializer is only called if the contentType option has been supplied.

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
4.00

avatar prtuson prtuson - open - 17 Mar 2022
avatar prtuson prtuson - change - 17 Mar 2022
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 17 Mar 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 17 Mar 2022
avatar Hackwar Hackwar - change - 17 Feb 2023
Labels Added: bug
avatar Hackwar Hackwar - labeled - 17 Feb 2023
avatar Hackwar Hackwar - change - 25 Aug 2023
Labels Added: PBF
avatar Hackwar Hackwar - labeled - 25 Aug 2023
avatar brianteeman brianteeman - change - 1 Sep 2023
Labels Removed: PBF
avatar brianteeman brianteeman - unlabeled - 1 Sep 2023
avatar Hackwar Hackwar - close - 28 Mar 2024
avatar Hackwar
Hackwar - comment - 28 Mar 2024

I created a PR: #43179 Closing this issue.

avatar Hackwar Hackwar - change - 28 Mar 2024
Status New Closed
Closed_Date 0000-00-00 00:00:00 2024-03-28 19:21:34
Closed_By Hackwar

Add a Comment

Login with GitHub to post a comment