Magento2: Saving CMS page does not create URL rewrite in Magento 2.1.0

Created on 1 Aug 2016  路  25Comments  路  Source: magento/magento2

Preconditions

  1. PHP 5.6.16
  2. MySQL 5.6.21-log
  3. Magento 2.1.0
  4. Nginx 1.4.6

    Steps to reproduce

  5. Create new CMS page in admin:
    hama-page-new-2

    Expected result

  6. Page should be accessible as /foo-bar

    Actual result

  7. 404 error:
    hama-3

  8. "foo-bar" doesn't appear anywhere in url_rewrite:
    SELECT * FROM url_rewrite WHERE request_path LIKE "%foo-bar%" returns nothing.

    Additional info

  9. CMS pages created before the 2.1.0 upgrade load fine.

CatalogUrlRewrite Fixed in 2.2.x Format is valid Ready for Work Reproduced on 2.1.x bug report

Most helpful comment

@Cacasapo, solved this issue! The URLs aren't indexing because pages aren't assigning to stores correctly.

  1. disable single-store mode, so you can always see which stores pages are assigned to:
    page-1
  2. Run this query to assign all pages to admin store:
INSERT INTO `cms_page_store` (page_id, store_id)

SELECT      page_id     `page_id`
        , 0     `store_id`
FROM        `cms_page`

ON DUPLICATE KEY UPDATE page_id=VALUES(page_id), store_id=VALUES(store_id)
  1. Pages should be assigned to at least the admin store, and now generate URLs correctly:
    page-2

All 25 comments

Magento 2.1 here. Upgrade from 2.0.8 with a custom theme installed. PHP 7.0.9, apache 2.4.23.

Just came across this issue and thought I was losing my mind. I still might be.

Created a couple different pages and they both 404...
url_rewrite populated with pre-2.1 entries, which work.

Hi @Cacasapo,

Are you also having URL rewrite issues with products, as described in #5929?

@JacobDrummond Just tested it and yes, that is also present on my install.

PS: This bug is NOT present on a 2.1 fresh install.

@JacobDrummond
Thank you for reporting this issue.
I can't reproduce it on Magento 2.1.0 & nginx>=1.8v
Your web server doesn't pass the requirements.
Please, re-check this issue on supported software or add some additional info.

@andimov, I also experience this bug locally on Apache/2.4.17, which is supported

@JacobDrummond
I can't reproduce it on Apache/2.4.18 also.

@andimov, this issue is not present on a fresh 2.1 install. Did you start with 2.1, or upgrade from 2.0.6?

@JacobDrummond

You should provide the appropriate steps and preconditions for reproducing.

@JacobDrummond
What mode do you have for indexers updates?
Try to switch mode for all indexers twice. Then reproduce this issue again.

@andimov,

You should provide the appropriate steps and preconditions for reproducing.

Sorry, I didn't know upgrading was a replication step until @Cacasapo mentioned it. Should I update issue descriptions as details emerge in a discussion?

Try to switch mode for all indexers twice. Then reproduce this issue again.

Switching indexer modes back and forth didn't make a difference. Aren't indexers irrelevant in this context, as Magento2 doesn't use indexers to maintain url_rewrite?

@Cacasapo, solved this issue! The URLs aren't indexing because pages aren't assigning to stores correctly.

  1. disable single-store mode, so you can always see which stores pages are assigned to:
    page-1
  2. Run this query to assign all pages to admin store:
INSERT INTO `cms_page_store` (page_id, store_id)

SELECT      page_id     `page_id`
        , 0     `store_id`
FROM        `cms_page`

ON DUPLICATE KEY UPDATE page_id=VALUES(page_id), store_id=VALUES(store_id)
  1. Pages should be assigned to at least the admin store, and now generate URLs correctly:
    page-2

@JacobDrummond @Cacasapo
Thank you for a solution!
Do you think it is a Magento bug?

@andimov, it appears to be a bug with single-store mode. I'll open a separate issue for it when I have time. See this comment.

@JacobDrummond Nice job on the workaround.

Thing is, a fix for the two issues you've found really needs to be in 2.1.1, which, hopefully, drops soon.

@JacobDrummond @Cacasapo
Thanks! I've created an internal ticket for this issue - MAGETWO-56863 and linked it to this one.

issue still exist in latest 2.1.1

issue exist in v. 2.1.2

Issue exists in 2.1.3..

MAGETWO-56863 fixes this issue in develop branch
Internal ticket for branch 2.1 - MAGETWO-58383

@veloraven What version of Magento will contain MAGETWO-58383? Are there commit references for this internal ticket?

@JacobDrummond, thank you for your report.
The issue is already fixed in 2.2.0

So, is the 2.1.x branch going to be abandoned for 2.2?

@Cacasapo I'm pretty sure 2.1 is not at EOL. But they want everyone to go to 2.2.

@magento-engcom-team Will the backport for 2.1 make it into the next release?

Was this page helpful?
0 / 5 - 0 ratings