1

IM having a weird instance where a page created via the CMS backend is not showing on the site. This is only happening on one of the pages out of 40 that i have newly created. I have tried deleting the page and remaking it but this produces the same error. I have also tried changing the status to Disabled and back to Enabled but that didn't work either.

I simply just get a white page with no errors in the console or otherwise. Any thoughts?

2
  • Have you tried creating this page with no content etc? Have you cleared caches?
    – Zak
    Jul 15, 2013 at 18:52
  • Which stores are selected in this cms page?
    – Simon H
    Jul 15, 2013 at 19:09

1 Answer 1

0

Your post is a little light on the details a programmer needs to help you, so here's how I'd debug this

Magento looks for a CMS page in the following method.

#File: app/code/core/Mage/Cms/Model/Resource/Page.php
public function checkIdentifier($identifier, $storeId)
{
    $stores = array(Mage_Core_Model_App::ADMIN_STORE_ID, $storeId);
    $select = $this->_getLoadByIdentifierSelect($identifier, $stores, 1);
    $select->reset(Zend_Db_Select::COLUMNS)
        ->columns('cp.page_id')
        ->order('cps.store_id DESC')
        ->limit(1);

    return $this->_getReadAdapter()->fetchOne($select);
}

This code generates a SQL query that compares the identifier in the URL with what it can find in the cms_page table. For someone reason this query is returning zero rows in your Magento instance. Add some temporary debugging code to output the SQL query

    $select->reset(Zend_Db_Select::COLUMNS)
        ->columns('cp.page_id')
        ->order('cps.store_id DESC')
        ->limit(1);

    echo '<pre>';
    echo $select->__toString();
    echo '</pre>';
    exit(__METHOD__ . '::' . __LINE__);
    return $this->_getReadAdapter()->fetchOne($select);

and determine why your query is returning no rows.

5
  • Well this is the message i got: SELECT cms_page.* FROM cms_page INNER JOIN cms_page_store ON cms_page.page_id = cms_page_store.page_id WHERE (cms_page.page_id='68') AND (is_active = 1) AND (cms_page_store.store_id IN (0, 1)) ORDER BY cms_page_store.store_id DESC LIMIT 1 Mage_Cms_Model_Resource_Page::_getLoadSelect::214 Jul 15, 2013 at 20:00
  • I looked in the DB and the paeg i am trying to access is indeed page id = 68. Still confused. Gremlins man.. Jul 15, 2013 at 20:04
  • @user2584696 Did you run the SQL against your database and get back a row? Jul 15, 2013 at 20:20
  • Yes, and its retrieving the correct page (row) and everything.. real confused now. Jul 15, 2013 at 21:16
  • @user2584696 Just re-read your question — a simple white page (with a blank HTML source?) indicated a PHP or Magento error of some kind. Put your site in developer mode, with display_errors set to 1 (or check both your Magento exception and PHP error log) and the error should become evident. Jul 15, 2013 at 23:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.