Skip to content

Get existing page data only on edit page #39746

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

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

Conversation

Mohamed-Asar
Copy link
Contributor

Description (*)

Get Page data only on the edit page

Fixed Issues (if relevant)

  1. Fixes "The CMS page with the "0" ID doesn't exist" log flood #39743

Manual testing scenarios (*)

  1. Log into admin
  2. Navigate to Content->Pages->Add New Page
  3. Verify System.log don't have any error log related to cms page

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)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)

Copy link

m2-assistant bot commented Mar 18, 2025

Hi @Mohamed-Asar. Thank you for your contribution!
Here are some useful tips on how you can test your changes using Magento test environment.
❗ 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
  13. Semantic Version Checker

You can find more information about the builds here
ℹ️ Run only required test builds during development. Run all test builds before sending your pull request for review.


For more details, review the Code Contributions documentation.
Join Magento Community Engineering Slack and ask your questions in #github channel.

@m2-github-services m2-github-services added Partner: Ziffity partners-contribution Pull Request is created by Magento Partner labels Mar 18, 2025
@Mohamed-Asar
Copy link
Contributor Author

@magento run all tests

@engcom-Hotel engcom-Hotel added the Priority: P2 A defect with this priority could have functionality issues which are not to expectations. label Mar 18, 2025
@engcom-Charlie engcom-Charlie added the Project: Community Picked PRs upvoted by the community label Apr 10, 2025
@engcom-Charlie engcom-Charlie moved this to Pending Review in Community Dashboard Apr 10, 2025
@engcom-Hotel
Copy link
Contributor

@magento run all tests

Copy link
Contributor

@engcom-Hotel engcom-Hotel left a comment

Choose a reason for hiding this comment

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

Hello @Mohamed-Asar,

Thanks for the contribution!

The changes seems good to us, but please fixed the failed static test.

Thanks

@Mohamed-Asar
Copy link
Contributor Author

@engcom-Hotel Static test failure is not related to this PR changes ? do you want me to fix that ?

@engcom-Hotel
Copy link
Contributor

Hello @Mohamed-Asar,

To proceed further with the PR, we need a green build, and for this you need to fix the static test failure. Please let us know if you have any query regarding that.

Thanks

@Mohamed-Asar
Copy link
Contributor Author

Sure @engcom-Hotel, Looks like we need to refactor the class, i will fix and let you know

@engcom-Hotel engcom-Hotel moved this from Pending Review to Changes Requested in Community Dashboard Apr 25, 2025
@engcom-Hotel
Copy link
Contributor

Hello @Mohamed-Asar,

Have you got a chance to look into this?

Thanks

@Mohamed-Asar
Copy link
Contributor Author

@engcom-Hotel i have started working on it, will let you know once done

@Mohamed-Asar
Copy link
Contributor Author

@magento run all tests

@Mohamed-Asar
Copy link
Contributor Author

@magento run all tests

@Mohamed-Asar
Copy link
Contributor Author

@engcom-Hotel Fixed the static test, please review

@engcom-Hotel
Copy link
Contributor

@magento run all tests

Copy link
Contributor

@engcom-Hotel engcom-Hotel left a comment

Choose a reason for hiding this comment

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

Hello @Mohamed-Asar,

Thanks for the updates!

The changes looks good to us, but some minor changes required as below. Please look into the review comments.

Thanks

Comment on lines 26 to 28
private PageRepositoryInterface $pageRepository,
private PageFactory $pageFactory,
private CustomLayoutManagerInterface $customLayoutManager,
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess all properties can be readonly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@engcom-Hotel added readonly

/**
* Cms Page Service Class
*/
class PageService
Copy link
Contributor

Choose a reason for hiding this comment

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

  • PageService can be unit tested for the logic of getPageById, createPageFactory, and fetchAvailableCustomLayouts.
  • Integration tests could ensure data provider works as expected in edit page scenarios.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@engcom-Hotel i have added unit test case, please review

@engcom-Hotel engcom-Hotel moved this from Review in Progress to Changes Requested in Community Dashboard May 27, 2025
@Mohamed-Asar
Copy link
Contributor Author

@magento run all tests

@ct-prd-projects-boards-automation ct-prd-projects-boards-automation bot moved this from Changes Requested to Review in Progress in Community Dashboard Jun 2, 2025
@ct-prd-projects-boards-automation ct-prd-projects-boards-automation bot moved this from Review in Progress to Ready for Testing in Community Dashboard Jun 3, 2025
@engcom-Bravo engcom-Bravo self-assigned this Jun 4, 2025
@engcom-Bravo engcom-Bravo moved this from Ready for Testing to Testing in Progress in Community Dashboard Jun 4, 2025
@engcom-Bravo
Copy link
Contributor

Hi @Mohamed-Asar,

Thanks for the collaboration & contribution!

✔️ QA Passed

Preconditions:

  • Install fresh Magento 2.4-develop

Steps to reproduce

  • Create admin user
  • Open BO->Content->Pages->Add New Page

Before: ✖️ 

[2025-06-04T08:08:07.146477+00:00] main.ERROR: The CMS page with the "0" ID doesn't exist. [] []

After: ✔️

system.log is empty

Builds are failed. Hence, moving this PR to Extended Testing.

Thanks.

@engcom-Bravo engcom-Bravo moved this from Testing in Progress to Extended testing (optional) in Community Dashboard Jun 4, 2025
@engcom-Dash engcom-Dash self-assigned this Jun 4, 2025
@engcom-Dash
Copy link
Contributor

@magento run all tests

@engcom-Dash
Copy link
Contributor

@magento run Functional Tests B2B, Functional Tests EE, Functional Tests CE

@engcom-Dash
Copy link
Contributor

The consistent test failures for Functional B2B are known Issues and JIRA is raised for them. Other failures are inconsistent and seems to be flaky. They neither part of PR nor failing because of the PR changes.

Build 1: https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/39746/c729012052df652ddd16635f7c144124/Functional/allure-report-b2b/#categories/8fb3a91ba5aaf9de24cc8a92edc82b5d

image

Build 2: https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/39746/9ddbda0a9fb980a7873dd3d9dd7b8da1/Functional/allure-report-b2b/index.html#categories/8fb3a91ba5aaf9de24cc8a92edc82b5d

Screenshot 2025-06-05 at 6 15 56 PM

Known Issues:
OrderWithMultipleConfigurableProductsAdditionalStockTest : ACQE-8060
EnablePaypalExpressCheckoutAndSubmitAnOrderUsingPaypalExpressCheckoutTest : ACQE-8007
StoreFrontSimpleProductWithSpecialAndTierDiscountPriceTest : ACQE-7971

The consistent test failure for Functional CE is known Issues and JIRA is raised for the same. Other failure is inconsistent and seems to be flaky. They neither part of PR nor failing because of the PR changes.

Build 1: https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/39746/c46daae5185acd6879e62aac8e5c3f41/Functional/allure-report-ce/index.html#categories/8fb3a91ba5aaf9de24cc8a92edc82b5d

image

Build 2: https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/39746/6f7d3938e098b01076be33249c61adb1/Functional/allure-report-ce/index.html#categories/8fb3a91ba5aaf9de24cc8a92edc82b5d

image

Known Issues:
EnablePaypalExpressCheckoutAndSubmitAnOrderUsingPaypalExpressCheckoutTest : ACQE-8007

The consistent test failure for Functional EE is known Issues and JIRA is raised for the same. Other failure is inconsistent and seems to be flaky. They neither part of PR nor failing because of the PR changes.

Build 1: https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/39746/318ccf3f139d5fb4e920ae0077bb8afd/Functional/allure-report-ee/index.html#categories/47999e1f828641ba54c4c4f35f7decea/4c7cdd5f84fcb655/

image

Build 2: https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/39746/a7080822ec085e377783bb9ce7b18945/Functional/allure-report-ee/index.html#categories/8fb3a91ba5aaf9de24cc8a92edc82b5d

image

Known Issues:
EnablePaypalExpressCheckoutAndSubmitAnOrderUsingPaypalExpressCheckoutTest : ACQE-8007

Hence moving this PR in Merge In Progress.

@engcom-Dash engcom-Dash moved this from Extended testing (optional) to Merge in Progress in Community Dashboard Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Partner: Ziffity partners-contribution Pull Request is created by Magento Partner Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Project: Community Picked PRs upvoted by the community
Projects
Status: Merge in Progress
Development

Successfully merging this pull request may close these issues.

"The CMS page with the "0" ID doesn't exist" log flood
6 participants