Error when saving Content Block edits

Permalink
I'm building a site and while saving my text added to a content block, I get an error. No error message, just a popup window with a portion of my site graphics in it with the word Error in the upper left corner. Anyone have an idea how to resolve this? Attached is a picture of the error window.

1 Attachment

Pixelfixer
 
balloondog replied on at Permalink Reply
Im getting this error too, since updating to 5.4.1. Very embarrassing when demoing to a client today :(

What's causing this?

Looks like i will have to downgrade again
Pixelfixer replied on at Permalink Reply
Pixelfixer
Balloondog, I don't think it is exclusive to v.5.4.1 since it first showed up for me while on v.5.4.0.5. I then upgraded to .1 thinking this would refresh the C5 code and fix the problem. It didn't. So I started a new copy of v.5.4.1 and uploaded my theme. Problem disappeared...for a while. It's back again and I don't know why. Have you had any luck?
Pixelfixer replied on at Permalink Reply
Pixelfixer
I think I found the solution to this problem and several other weird behaviors. Through the help of several different posts related to the topic of working around jquery / javascript I discovered these coding standards (new standards for me at least):

I am using a theme structure (as many others do) of a default.php that uses includes of a header.php and a footer.php. With this structure here are a few steps that I found to resolve my problems:

1) Start your default.php with

'<?php
defined('C5_EXECUTE') or die(_("Access Denied."));
$this->inc('elements/header.php');
?>'


2) For some reason, I had started header.php and footer.php with the code line:

'<?php defined('C5_EXECUTE') or die(_("Access Denied."));?>'

Don't do that. Only needed in the default.php page.


3) Keep your javascript lines after (or below) the following code line:

'<?php Loader::element('header_required'); ?>'


4) Surround your javascript code lines with 'isEditMode()' code like this:
<?php 
global $c; if(!$c->isEditMode()) {
?>
<script src="<?=$this->getThemePath()?>/Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<?php } 
//end of check of edit mode ?>


This disables the javascript during edit mode. This also opened up my Spry accordion menu routines so I could setup editable blocks within the panels and access them in Edit Mode.


Hope this helps someone else. It worked great for me!
Pixelfixer replied on at Permalink Reply
Pixelfixer
Well, I thought my problems were over, but then I began working on some simple subpages and this problem popped up again. I'm getting an error window that pops up when I try to save content in a new Content Block. It also appears to log me out at the same time. I noticed that when I close the Error pop-up window and then click on the Dashboard button on the Editor bar, I'm given a login screen. If I instead click on the "Exit editing" button I get a drop-down message that says access denied.

**Solved - See "best answer" link in this thread.
Pixelfixer replied on at Permalink Best Answer Reply
Pixelfixer
I finally paid the $125 to have an expert look at this problem and it turned out to be a simple fix that I probably would have never seen. So, money well spent. (should have done it sooner).

I have a couple of sites in development at the same time and I set them up using subfolders under my domain while in development. It turns out that I should have been using sub-domains to contain each site instead. Because I used the "Pretty URLs" option on one of the sites, requiring an ".htaccess" file in the root of my domain, this file caused the conflict, during edit, on my second site. The problem was resolved by creating sub-domains for each of my sites in development and then moving the ".htaccess" file to the root of the subdomain requiring it.

I hope this documentation helps someone else. It would have saved me several hours of frustration.
dg1 replied on at Permalink Reply
Thanks for taking the time to post your findings. This will surely help someone out in a pinch.
- Donna
mckoenig replied on at Permalink Reply
mckoenig
I have the exact same problem. And an .htaccess in every subdirectory for each of my two sites. And it worked perfectly for some time. But now this error happens. The REALLY odd thing is - it only happens if I manually add a text link or change something in the HTML view of the editor. If I add a link via the link-to-page or link-to-file buttons c5 provides there is no error. Same goes for normal text or any other kind of edit.
ANY help is very appreciated.
Pixelfixer replied on at Permalink Reply
Pixelfixer
"And an .htaccess in every subdirectory for each of my two sites."

I don't know if this is a typo or not, but you mention you have a .htaccess in every "subdirectory". I discovered that I needed to setup a "subdomain" for each site I was working on. Could that be the problem?
mckoenig replied on at Permalink Reply
mckoenig
I've got two installs in two directories on the same level. But both directories are connected to different domains.
http://www.sitea.com -> foldera
http://www.siteb.com -> folderb
This makes each folder the root of the given domain. Thus each folder has its own .htaccess.

This setup always worked before. I'm trying a clean reinstall right now. Let's see if it helps.
Pixelfixer replied on at Permalink Reply
Pixelfixer
Yes. That should be working fine. So it must be something else. (I'm guessing you've cleared your cache, probably a few times, right?) If it still happens after a clean install I'd be glad to take a look at it for you. Just pm me with a url, login ID and PW. Sometimes it just takes a different perspective to see the problem. Anyway, good luck with it.
mckoenig replied on at Permalink Reply
mckoenig
It seems this resolved the error. I'll look into it further tomorrow (about 1:30am here right now).
And thank you for the offer of help! Very much appreciated, but it seems as the clean install resolved the issue.
Pixelfixer replied on at Permalink Reply
Pixelfixer
Excellent! Hope it sticks.
mckoenig replied on at Permalink Reply
mckoenig
Clean install resolved the error. I can't recommend using the built in update function of concrete5 as long as such errors can happen.