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

Fixed issue where removing breadcrumbs removes the page title #29437

Open
wants to merge 3 commits into
base: 2.4-develop
Choose a base branch
from

Conversation

realchriswells
Copy link

@realchriswells realchriswells commented Aug 7, 2020

Description (*)

There was an issue in the 2.1 branch where if you removed the breadcrumbs via XML:
<referenceBlock name="breadcrumbs" remove="true" />, the page title would also be removed, leaving behind empty <title> tags in the <head>. This fixed in the 2.1 branch, but it seems that some regression has occurred and it is back. I'm reapplying that code change.

Related Pull Requests

The original PR is here.

Manual testing scenarios (*)

  1. Remove breadcrumbs block in XML
  2. Go to the category view or product view page
  3. Check Page title in browser tab

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

Resolved issues:

  1. resolves [Issue] Fixed issue where removing breadcrumbs removes the page title #29651: Fixed issue where removing breadcrumbs removes the page title

@m2-assistant
Copy link

m2-assistant bot commented Aug 7, 2020

Hi @realchriswells. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests

You can find more information about the builds here

ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

For more details, please, review the Magento Contributor Guide documentation.

⚠️ According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@realchriswells
Copy link
Author

@magento run all tests

@realchriswells
Copy link
Author

@magento run Static Tests

@rogyar rogyar self-assigned this Aug 7, 2020
Copy link
Contributor

@rogyar rogyar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, cannot reproduce this issue on the 2.4-develop branch.

Steps:

  • Create a custom module
  • Use catalog_product_view.xml and add <referenceBlock name="breadcrumbs" remove="true"/>
  • Check the product details page

Result:

  • No breadcrumbs on the page
  • <title> tag is present and contains a correct value

@ghost ghost moved this from Pending Review to Changes Requested in Pull Requests Dashboard Aug 7, 2020
@realchriswells
Copy link
Author

realchriswells commented Aug 7, 2020

Hi @rogyar

Apologies, this just seems to affect the category pages. Please try the updated steps to replicate below.

The steps I took to replicate the issue were:

  1. Install 2.4 with sample data
  2. Create new theme based on Magento/blank
  3. Set theme as current
  4. Create folder Magento_Catalog in theme
  5. Create layout/catalog_category_view.xml:
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="breadcrumbs" remove="true" />
    </body>
</page>
  1. Clear caches and ensure theme is built
  2. Go to a category page and notice that the breadcrumb has gone, but the <title> tag is empty.

@rogyar
Copy link
Contributor

rogyar commented Aug 9, 2020

Hi, @realchriswells. Thanks for the clarification. I'm able to reproduce it for the category view page with breadcrumbs block removed in the XML layout.

I've double-checked the original PR and looks like the changes were not ported to 2.2/2.3 for some reason. Frankly speaking, the fix looks like an "ad-hoc" solution. But, on the other hand, taking the page title from breadcrumbs (the current solution) is even more questionable. I believe it has been implemented in this way for a reason, so let's leave it as it is.

According to the definition of done, all changes should be covered by autotests. I would ask you to provide a simple test for this case. You may extend the existing test

public function testCategoriesSequence(): void

You may remove the breadcrumbs block using $this->layout and make sure that the title is not empty in the result output.

Thank you!

@rogyar rogyar added the Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests label Aug 9, 2020
@engcom-Charlie engcom-Charlie self-assigned this Aug 17, 2020
@sidolov sidolov added Priority: P3 May be fixed according to the position in the backlog. Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. labels Aug 18, 2020
@sidolov
Copy link
Contributor

sidolov commented Aug 18, 2020

@magento create issue

@sidolov
Copy link
Contributor

sidolov commented Aug 26, 2020

@realchriswells I am closing this PR now due to inactivity.
Please reopen and update if you wish to continue.
Thank you for the collaboration!

@sidolov sidolov closed this Aug 26, 2020
@m2-assistant
Copy link

m2-assistant bot commented Aug 26, 2020

Hi @realchriswells, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@ghost ghost removed this from Changes Requested in Pull Requests Dashboard Aug 26, 2020
@realchriswells
Copy link
Author

I wish to continue with this.
Just getting the tests sorted.

@realchriswells
Copy link
Author

@engcom-Charlie @rogyar
Please could this be reopened?
Also, is there anyone who is able to help me write these tests as they are proving to be difficult for me to write.

@engcom-Charlie engcom-Charlie reopened this Nov 2, 2020
@m2-assistant
Copy link

m2-assistant bot commented Nov 2, 2020

Hi @realchriswells. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests

You can find more information about the builds here

ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

For more details, please, review the Magento Contributor Guide documentation.

@ghost ghost added this to Changes Requested in Pull Requests Dashboard Nov 2, 2020
@chickenland
Copy link
Contributor

@magento run all tests

@engcom-Bravo engcom-Bravo self-assigned this Nov 4, 2020
@realchriswells
Copy link
Author

@rogyar Is it possible you or someone else on here could help me out with writing the tests, I'm out of my depth on those.

@realchriswells
Copy link
Author

The other day there was a post on here confirming that a manual test was completed and accepted, but then it disappeared.
What is the next step for this PR?

@@ -4,6 +4,8 @@
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, don't use this annotation. Even if this page contains some legacy approaches, they should be visible.
On the other hand, I see that some of your edits contain changes that don't meet the PSR coding standards (line length exceeds 120 chars). Please, remove this annotation and run the static tests once again.

Thank you

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've done this now, and fixed the PSR coding standards issue you referenced.

As of now it is passing all tests bar the Functional Tests. What needs to be done next?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By adding this directive you don't "fix" the coding standard issues but tell the system to ignore them :)
Using such directives is not allowed in most cases (including this one). If there are failing static tests, every issue that causes the failing test should be addressed by adjusting the code for meeting the standards.

Thank you.

@realchriswells
Copy link
Author

@magento run Static Tests

@realchriswells
Copy link
Author

@magento run all tests

@m2-community-project m2-community-project bot moved this from Changes Requested to Review in Progress in Pull Requests Dashboard Nov 11, 2020
@realchriswells
Copy link
Author

@rogyar This seems to have stalled. Are you able to tell me where things need to be to get this over the line?

@rogyar
Copy link
Contributor

rogyar commented Dec 12, 2020

Hi @realchriswells as we have discussed in Slack, the auto-test coverage is still required.

@realchriswells
Copy link
Author

@magento run all tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests Component: Catalog Partner: Pinpoint partners-contribution Pull Request is created by Magento Partner Priority: P3 May be fixed according to the position in the backlog. Progress: review Release Line: 2.4 Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround.
Projects
Pull Requests Dashboard
  
Review in Progress
Development

Successfully merging this pull request may close these issues.

[Issue] Fixed issue where removing breadcrumbs removes the page title
7 participants