RTC PR-4.4-dev Pending

User tests: Successful: Unsuccessful:

avatar muhme
muhme
4 Aug 2024

Summary of Changes

Fix newsfeed category html view as down-merge from 5.1-dev. This is a sub-part from #43722 to use joomla-cypress 1.1.1 in 4.4-dev too.

Testing Instructions

The warning is displayed in A) the frontenend view and B) the System Test (with a speaking checkForPhpNoticesOrWarnings). Verify the warning before patching. After patching, check that there are no more warnings.

Actual result BEFORE applying this Pull Request

A) Manual Test

Requesting URL /index.php?option=com_newsfeeds&view=category&id=5 in fresh 4.4-dev shows the PHP Warning message (id comes from Components | News Feeds | Categories | Uncategorised):
shoot

B) System Test

As preparation install speaking checkForPhpNoticesOrWarnings in overwriting lines 74 ... 89 in node_modules/joomla-cypress/src/support.jswith the following lines:

  Cypress.Commands.add('checkForPhpNoticesOrWarnings', () => {
    cy.log('**Check for PHP notices and warnings**')

    cy.document().then((doc) => {
      const pageSource = doc.documentElement.innerHTML
      // Search for PHP problem keywords in bold style with colon and collect the found keyword and the message
      const regex = /<b>(Warning|Deprecated|Notice|Strict standards)<\/b>:(.*?)(<br|$)/
      const match = regex.exec(pageSource)
      if (match) {
        // Directly fail with the reason, the keyword found and report the PHP problem message, e.g.
        // Error: Unwanted PHP Warning: "Attempt to read property \"id\" on null in <b>/joomla-cms/components/com_newsfeeds/src/View/Category/HtmlView.php</b> on line <b>92</b>"
        throw new Error(`Unwanted PHP ${match?.[1]}: ${JSON.stringify(match?.[2])}`)
      }
    })

    cy.log('--Check for PHP notices and warnings--')
  })

Run the test specifications:

npx cypress run --spec tests/System/integration/site/components/com_newsfeed/Category.cy.js

Fails with:

  Running:  Category.cy.js                                                                  (1 of 1)

  Test in frontend that the newsfeeds category view
    ✓ can display a list of feeds in a menu item (539ms)
    1) "after each" hook for "can display a list of feeds without a menu item"

  1 passing (1s)
  1 failing

  1) Test in frontend that the newsfeeds category view
       "after each" hook for "can display a list of feeds without a menu item":
     Error: Unwanted PHP Warning: "  Attempt to read property \"id\" on null in <b>/Users/hlu/Desktop/no_backup/joomla-cms/components/com_newsfeeds/src/View/Category/HtmlView.php</b> on line <b>92</b>"

? With overwritten speaking checkForPhpNoticesOrWarnings, if you run the entire system tests, there are four failures before this PR and only three after. The remaining three errors are fixed by #43880 and #43881.

Expected result AFTER applying this Pull Request

No warnings in A) frontend view or B) System Test.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

Up-Merging

@LadySolveig @bembelimen there is no up-merge required as it is only a down-merge from 5.1-dev

avatar muhme muhme - open - 4 Aug 2024
avatar muhme muhme - change - 4 Aug 2024
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 4 Aug 2024
Category Front End com_newsfeeds
avatar muhme muhme - change - 4 Aug 2024
The description was changed
avatar muhme muhme - edited - 4 Aug 2024
avatar alikon alikon - test_item - 5 Aug 2024 - Tested successfully
avatar alikon
alikon - comment - 5 Aug 2024

I have tested this item ✅ successfully on fe9bd06


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43879.

avatar muhme muhme - test_item - 5 Aug 2024 - Tested successfully
avatar muhme
muhme - comment - 5 Aug 2024

I have tested this item ✅ successfully on fe9bd06

To warm up with Joomla! Patch Tester, I tested my own PR with A) Manual Test on local 4.4.7-dev, frontend URL /index.php?option=com_newsfeeds&view=category&id=5 shows "Warning: Attempt to read property "id" on null in /Users/hlu/Desktop/no_backup/joomla-cms/components/com_newsfeeds/src/View/Category/HtmlView.php on line 92" After applying the PR the warning is gone.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43879.
avatar fgsw fgsw - test_item - 6 Aug 2024 - Tested successfully
avatar fgsw
fgsw - comment - 6 Aug 2024

I have tested this item ✅ successfully on fe9bd06

Manual Test (A) only.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43879.

avatar laoneo laoneo - change - 6 Aug 2024
Status Pending Ready to Commit
avatar laoneo
laoneo - comment - 6 Aug 2024

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43879.

avatar laoneo laoneo - change - 6 Aug 2024
Labels Added: RTC
avatar laoneo laoneo - change - 6 Aug 2024
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2024-08-06 08:50:28
Closed_By laoneo
Labels Added: PR-4.4-dev
avatar laoneo laoneo - close - 6 Aug 2024
avatar laoneo laoneo - merge - 6 Aug 2024
avatar laoneo
laoneo - comment - 6 Aug 2024

Thanks!

Add a Comment

Login with GitHub to post a comment