Database Randomly Doesn't Load

Permalink
I have used multiple versions of concrete5 on multiple websites over the past 4 years. One thing I have noticed will all versions I've used of concrete5 is sometimes myself (or another visitor) will visit a concrete5 website and be unable to view all information on a page that is supposed to be pulled from the database.

Recently (today) I received a call from a visitor to one of the websites saying they could not view information on a page, yet, when I loaded it up, everything looked fine to me. The website we were both viewing has Version: 5.6.1.2

Has anyone else encountered this problem, where one person can see everything fine on a page and another user in separate location can not? This seems to be a problem with all versions I've used in the past 4 years.

Any help would be appreciated. Thank you!

**Apologies if this post is in the wrong category, I was unsure of the correct category it should be posted in. Also apologies if this has been posted before. If it has, someone please direct me to that post, as I could not find one.

 
johnpaulb replied on at Permalink Reply
johnpaulb
Hi Arkelope,

Are they getting a database error on the page? Usually it will say what the error is.

Also, a database problem would typically affect everyone using the site.

After they refresh the page, does it load for them?

What type of browser are they using and what version? I recommend trying in the same browser.

It is possible that their browser is having trouble rendering something in the page. This is very common with outdated browsers, for example IE7.

I hope this helps,
John-Paul
Arkelope replied on at Permalink Reply
John Paul,

Thanks for the reply. The viewer is seeing all of the hard data load (the hard coded information from the php template file) but not any information coming from the database. I've actually seen this happen myself too. There is no error log that comes up. Only once has it happened at the same time where myself and another visitor (across the US, so using another Internet Provider) where we see template information but no content from the database.

We have all tried multiple browsers (including all up-to-date ones) at the same time as the incident. My typical viewing browser is Google Chrome, but I've used all of them when a page data doesn't display - and none of the browsers display the information - rendering the browser theory mute.

A few months ago I had a visitor tell me he couldn't view a page's content - and I loaded it up just fine. Days later it was the complete opposite, where all the sudden I couldn't view the page's database content, but he could - at the same time.

Also, we've rendered the Internet Provider thing mute because when the issue happens, it's usually to one page, not the whole website. We can all view the other pages just fine. And the issue to a page is random - it's happened to pages that we work on a lot, and pages we hardly touch.

I've determined this is a concrete5 database error in the code that has gone unnoticed - and I'm starting to get worried using this CMS due to this problem now happening more often.
SheldonB replied on at Permalink Reply
SheldonB
what dose your theme code look like ?

I have run into some strange stuff like data not rendering correctly because I was using a global area and changed it to a normal content area - but it was never as extreme to completely not render the data in that area

http://www.concrete5.org/documentation/how-tos/designers/common-the...

if you click on a link in your page and you can see the page such as the theme but no data (ie blocks) it could mean there is something wrong with the way you are calling the area that allows it to work sometimes but not all the time...

if c5 was unable to talk to its data base you would see a pretty distinct error
Arkelope replied on at Permalink Reply
Sheldon,

Thanks for your reply! You might have shed light on a possible issue. This is what I am using:

For opening body:
<body <?php global $cp; echo ($cp->canWrite()) ? 'class="c5-edit-mode"' : ''; ?> >

The "c5-edit-mode" is used to push the background down 48 pixels (background-position: center 48px;)

Here's what I'm using for a regular block:
<? $a = new Area('subMain'); $a->display($c); ?>

Do you think converting the "Area" to "GlobalArea" would help with the issue? (and obviously paying attention to the "don't reference $c when you make a Global Area" remark as well)
SheldonB replied on at Permalink Reply
SheldonB
no

but i think the way you are calling things is incorrect

ie ?php
not ?
(I don't think short tags work in c5 so that might be your issue where sometimes it works and sometimes it doesn't)

'whatevername' -however if you change your theme you need to keep the same name

<?php 
$a = new Area('Main');
$a->display($c);
?>


not sure about the first part

I stole this from concrete/themes/default(change the min-height to your needs)

it just needs to be placed before your header

<?php  if ($c->isEditMode()) { ?>
      <div style="min-height: 80px">
      <?php  } ?>
      <!-- insert Short height area here -->
      <?php 
      // we use the "is edit mode" check because, in edit mode, the bottom of the area overlaps the item below it, because
      // we're using absolute positioning. So in edit mode we add a bit of space so everything looks nice.
      ?>
      <?php  if ($c->isEditMode()) { ?>
      </div>
      <?php  } ?>
Arkelope replied on at Permalink Reply
Sheldon,

Thank you very much for your answer. I have gone through and added ?php to the areas that need it, as well as updated the global bump necessary while logged in, right after the (now clean) <body> tag. I logged in and everything seems to be looking normal.

I am going to leave this updated website the way it is and test it vs another one that I did not update. If I can get viewers to see issues with the one not updated, but they are not having any trouble with the one that has been updated, then we obviously can pinpoint the issue on using the shorthand code ( <? ).

I will update with any results I have. For anyone else reading this, don't use the shorthand code! :)

Thank you again!
JohntheFish replied on at Permalink Reply
JohntheFish
Short php tags <? are either enabled or disabled by your php server environment.

Concrete5 and all addons are always distributed with full php tags <?php in the code. On Github, much of the c5 core only has short tags which are then batch replaced with full tags when a new version is built.
bw1 replied on at Permalink Reply
Hold the phone here. I've got the following all over dozens of sites I've created:

<? $a = new Area('Main'); $a->display($c); ?>
<?=$this->getThemePath()?>/

I've questioned it the entire time, but have looked it up multiple times and verified that yes, this was the code in the tutorials and examples.

So what's the deal -- should these be <?php or <?

I believe I've even tried replacing them with <?php in the past and it broke things, so I reverted to short tags.
Arkelope replied on at Permalink Reply
All,

After going through and updating my php tags to "?php" I thought things were fine for awhile. Today, my client informed me that the issue happened again, where one of their visitors said they went to the website and all it loaded was the background image set by the body tag and nothing else. They said they were using Internet Explorer, but they didn't say of a version. I'm guessing they were using an older version, like IE8 or IE7 due to the nature of the client's visitors (school teachers in old buildings on old computers).

The website that is having so much trouble ishttp://www.peacefulschools.com

Does anyone else ever have this issue with a concrete5 website? This has been going on since I have been using the CMS, so multiple versions.

Any help is greatly appreciated, as the client is starting to get weary concrete5 isn't good for them and will bolt to Wordpress.