Magento2: New CMS Page Not working

Created on 20 Jul 2016  路  17Comments  路  Source: magento/magento2

Steps to reproduce

  1. Install Magento 2.1 from any source.
  2. Set Enable Single-Store Mode to Yes
  3. Create a new CMS Page

    Expected result

  4. CMS Page is created

  5. New Page can be accessible from the frontend

    Actual result

  6. CMS Page is created

  7. Returns 404 when trying to access the page from the frontend

    Issue

On the database the cms_page_store doesn't create the registers when the Single-Store Mode is enable.

Cms Fixed in 2.2.x Fixed in 2.3.x Format is not valid Ready for Work bug report

Most helpful comment

Steps reproduce

  1. Set Enable Single-Store Mode to Yes
  2. Create a new CMS Page

Expected result

CMS page will saw in frontend

Actual result

CMS page will not display

Review below file

https://github.com/magento/magento2/blob/develop/app/code/Magento/Cms/Model/ResourceModel/Page.php#L152

i have print value of two variable

echo 'field : ' . $field
echo 'value: ' . $value

output :
field : identifier
value : no-route

That means when we create new CMS page in Single store mode identifier not fetch correct.

Solution

Open cms pages list , click on cms page ( grid view pullout that row and ask for ( cancel and save ) , now click on save.

now open you CMS page , its will display....

All 17 comments

same issue 2.1/ php7/nginx

not just single store with multi store too have same issue.

Same Issue here. I had to manually associate value in cms_page_store to get the page working.

Steps reproduce

  1. Set Enable Single-Store Mode to Yes
  2. Create a new CMS Page

Expected result

CMS page will saw in frontend

Actual result

CMS page will not display

Review below file

https://github.com/magento/magento2/blob/develop/app/code/Magento/Cms/Model/ResourceModel/Page.php#L152

i have print value of two variable

echo 'field : ' . $field
echo 'value: ' . $value

output :
field : identifier
value : no-route

That means when we create new CMS page in Single store mode identifier not fetch correct.

Solution

Open cms pages list , click on cms page ( grid view pullout that row and ask for ( cancel and save ) , now click on save.

now open you CMS page , its will display....

Hi guys

Can you upgrade to 2.1.1 and recheck if this issue is still actual? I have tried it on 2.1.1 and my page was available by url key from "Search Engine Optimization".

Thanks for contributing!

This is still an issue in 2.1.1

Can confirm this issue in 2.1.1 also

Hi,
Yes and no :-)
Please take a look at this video, where I test it on 2 sites on the same server.
One site is a clean 2.1.1 installation, and one site is an update from 2.0.7 to 2.1.1.
The bug is in the updated version.
The server is running: PHP Version 7.0.11

Here is the video link: https://goo.gl/oRoCeB

Hi, the bug still seems to bei present in a fresh Magento 2.1.3 installation. After interserting
(, 0) into the cms_page_store table the newly created cms page was usable.

Experiencing the same issue here.
After some R&D, i found that the new page somehow is only added to the cms_page table but not cms_page_store. If I manually add the relationship in cms_page_store, the page loads.
This issues is due to "Single Store Mode". If you enable the Single Store Mode, this problem exists. Disable Single Store Mode from Store > Configuration > General > General > Single Store Mode (Select No)
Refresh the cache, create a CMS page. Its work fine.

Hope! This will help you @j1nx3d

Still broken in 2.1.5
Manually adding page to cms_page_store table fixes problem.

This is still an issue, and one that can easily be resolved (by Magento) I think as there are 3 lines that would need to be changed. The problem is that the page save controller is using the deprecated way to save a model. @magentodevleper is right - saving inline actually works fine. Currently \Magento\Cms\Controller\Adminhtml\Page\Save::execute() loads the model directly, and then saves it directly.

This can easily be fixed by simply using \Magento\Cms\Api\PageRepositoryInterface to load the page model and then save it.

@bassplayer7, nice catch!
Here's the relevant piece of code.

The most annoying thing is that if you switch back to the develop branch you'll see that there's already a fix done as early as in October 2016. There's even an internal ticket MAGETWO-58383 created with the sole purpose of backporting that fix to 2.1.

Does it really take half a year to cherry-pick a bunch of commits? The word "embarrassing" comes to mind.

Has this been fixed I have the same problem using Magento ver. 2.1.6
I am in single store mode which if I change to single store-no should fix the problem, however the whole store has been created in single store mode, will change to not single store create any problems.

okay works now without change store mode, reindexed and flushed and works okay.

Internal ticket was created for this issue -- MAGETWO-69926

Hi @j1nx3d
Fix for this issue is already released with 2.2.0. You may use commits prefixed with MAGETWO-56863
for reference.
We are considering to backport this fix into previous versions, however there is no specific schedule for now.
Thank you.

Was this page helpful?
0 / 5 - 0 ratings