Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.0] Active menu does not exist, fatal error #31100

Closed
wants to merge 1,667 commits into from

Conversation

sakiss
Copy link
Contributor

@sakiss sakiss commented Oct 15, 2020

Pull Request for Issue # .
#30812

Summary of Changes

$app->getMenu()->getActive();
can return a MenuItem or null

by calling a function when null is returned, it generates a fatal error.

Testing Instructions

Add a dummy/non existent ItemId in your non sef urls.
E.g. /index.php?option=com_content&view=article&id=2:another-article&catid=9&itemId=5000
In that case there is no menu item with id 5000

Actual result BEFORE applying this Pull Request

Screenshot_joomla_missing_menu_ietm

Expected result AFTER applying this Pull Request

No fatal error

Documentation Changes Required

No

@SharkyKZ
Copy link
Contributor

Can you do it the same as in error.php?

$menu = $app->getMenu()->getActive();
$pageclass = $menu !== null ? $menu->getParams()->get('pageclass_sfx', '') : '';

Otherwise $pageclass is undefined when no menu item.

@richard67
Copy link
Member

@SharkyKZ This PR here changes error.php, too, and I don't understand why. It was ok like it was before, or not? Am I missing something?

@richard67
Copy link
Member

@sakiss Please revert your change in error.php. It was good like it was before, using the ternary expression, and you now introduced an error with undefined $pageclass when there is no menu item. And as @SharkyKZ suggested please change index.php so it uses the same ternary expression as error.php does without your change.

@richard67
Copy link
Member

@sakiss And in addition to the above comment, please update the branch of this PR to the latest 4.0-dev branch of the CMS repository, not of your fork. It seems your 4.0-dev branch was very outdated when you have created this PR and the other one, #31099 based on it, because both PRs fail in our automated test due to outdated testing configuration from before February.

Let me know if you need help with.

Thanks in advance.

@richard67 richard67 added the Updates Requested Indicates that this pull request needs an update from the author and should not be tested. label Oct 16, 2020
@richard67
Copy link
Member

Added the "Updates Requested" label so it's clear for testers that this PR needs changes as specified in review comments above.

infograf768 and others added 20 commits October 16, 2020 20:48
…from 3.10 (joomla#30383)

* Move mod_version to position "status" on update from 3.10

* Revert "Move mod_version to position "status" on update from 3.10"

This reverts commit 71719e1.

* Move mod_version to the right place when updating from 3.10

* SQL CS even if I don't like this but it seems to be commonly used
* Check multilanguage setting to display language column

* Optimize code

* Apply check to Contacts and Newsfeeds

* Add multilanguage check

* Check frontend too

* Revert
)

* [4.0] Installation: Adding a hint in Password field

* fix accessibility

* Added small
* [4.0] Fix Safari issue with overflow hidden

* correcting scss format

* Another solution adapted to various versions of Safari

* scss cs

* scss cs

* last scss cs...
* [4.0] URL LANGUAGE CODE is not a prefix

* modified desc as suggested
chmst and others added 20 commits October 16, 2020 20:49
* Add Icon Webpage to contact config

* add webpage to the list, add alt-texts to images, remove the old images

* if no image is set, use an icon instead

* add an icon for msc information

* remove old icons for contact

* remove spaces, indent

* phpcs shoter lines, phpcs

* replace empty(..) by !(   )

* Update components/com_contact/tmpl/contact/default_address.php

Co-authored-by: Quy <[email protected]>

* Update components/com_contact/tmpl/contact/default_address.php

Co-authored-by: Quy <[email protected]>

* Update components/com_contact/tmpl/contact/default_address.php

Co-authored-by: Quy <[email protected]>

Co-authored-by: Quy <[email protected]>
Removes the margin bottom from tables included in cpanel cards.
Add missing import so that "Exception\ResourceNotFound" is correctly resolved.
* Move calls out of the loop

* Combine pathinfo() calls
…a#31066)

Variable key is used in both the inner and outer foreach loops which could cause issues (it doesn't but it could, and is code smell reported by phpStorm)
Return value type is not compatible with declared type in PHPDoc block
This fixes joomla#30967. When empty searches are allowed and the search is non-empty, but not matching, then it shouldn't return any results.
…app (joomla#31060)

* Update PHPDoc comment to match method signatures in installation app

* Update PHPDoc comment to match method signatures in installation app

* code style

* Update installation/src/Application/InstallationApplication.php

Co-authored-by: Richard Fath <[email protected]>

* Update installation/src/Application/InstallationApplication.php

Co-authored-by: Richard Fath <[email protected]>

* Update installation/src/Application/InstallationApplication.php

Co-authored-by: Richard Fath <[email protected]>

Co-authored-by: Richard Fath <[email protected]>
* [4.0] Share image link

Steps to reproduce the issue
Go to media manager in admin, select an image and select to get the shareable link.
click "Get shareable link"

Expected result
When clicking the copy button, the left border doesn't disappear

Actual result
left border of the copy button disappears on click, and on any click/selection of the actual url

* cs
Fix paths in codeowners file.
@sakiss
Copy link
Contributor Author

sakiss commented Oct 16, 2020

I am closing this due to conflicts. Will open a new one.

@sakiss sakiss closed this Oct 16, 2020
@sakiss sakiss deleted the active_menu_null branch October 16, 2020 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Unit/System Tests Updates Requested Indicates that this pull request needs an update from the author and should not be tested.
Projects
None yet
Development

Successfully merging this pull request may close these issues.