Block won't delete, PHP fault?

Permalink 1 user found helpful
Hi All,

Who can help me. I have created 3 custom blocks in my full.php template. I can ad blocks onsite but i can not delete them. If i delete them the disappear but when i save and publish the blocks are still visible on the site. I am still new to php so i can not fix this... I have tried to make all cases unique, the divs are unique etc.

<body>
   <div id="main_back">
       <div id="main_inner">
<div id="content">
    <?php
    $a = new Area('Main');
    $a->display($c);
    ?>
</div>
<div id="content2">
    <?php
    $f = new Area('Main2');
    $f->display($c);
    ?>
</div>

gerkwil
 
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
Try changing $f and $g to $a
gerkwil replied on at Permalink Reply
gerkwil
had that in the first case, thought that was the problem because they were all te same. Tried to delete the blocks. in both cases they wont delete.
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
Have you cleared the cache..
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
In fact if you are still building your site, I would recommend turning off all caching
gerkwil replied on at Permalink Reply
gerkwil
Cache is turned off, but to be sure cleared the cache anyway, does not do it...
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
Does your theme have a separate footer.php file as I see some problems with you calling the footer in the last few lines of your code?
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
Assuming you do have a footer.php file try this code
<body>
   <div id="main_back">
       <div id="main_inner">
<div id="content">
    <?php
    $a = new Area('New Area One');
    $a->display($c);
    ?>
</div>
<div id="content2">
    <?php
    $a = new Area('New Area Two');
    $a->display($c);
    ?>
</div>
gerkwil replied on at Permalink Reply
gerkwil
Thanks for the answer, unfortunately it did not work, when using that code i was not able to add blocks either. I have a footer, it is required. But i have deleted the line
<?php $this->inc('elements/footer.php'); ?>
because it does not seem to do anything because my footer.php is empty. (i dont understand why it is required...)

But the blocks still wont delete
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
What theme are you using?
gerkwil replied on at Permalink Reply
gerkwil
I am using a custom theme, two pagetypes, 2 css, 1 view, 1 default. I took an c5 theme and ajusted it.
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
Can you zip your theme and send it to me on a private message, I will take a look for you.
Rgds
Weyboat
mhawke replied on at Permalink Reply
mhawke
Be careful with all the footer stuff.

Loader::element('footer_required')

is not the same thing as

$this->inc('elements/footer.php')

They may look the same but they are not. The 'Loader' function loads core functionality such as the Edit Bar. DO NOT remove this line.

The '$this->inc...' code includes the 'footer.php' file from inside your theme's "elements" folder. You might break your page if you delete this line because the 'footer.php' file often contains HTML that completes the structure of the page.

What C5 theme did you base your custom theme on?
gerkwil replied on at Permalink Reply
gerkwil
Did not know that, thanks! Then it is best to keep both thoses lines in the template i guess, the only line in the footer is:

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


I cant remember the base theme i have modified, i believe it was Pinstripe but i am not sure... There is nothing in the theme that is original anymore.
mhawke replied on at Permalink Reply
mhawke
Is there a live URL we could have a look at?
gerkwil replied on at Permalink Reply
gerkwil
http://www.seoshit.nl
mhawke replied on at Permalink Reply
mhawke
There appears to be some serious structural problems with this theme.

1) You are calling the core jquery.js, twice.
2) You have HTML inside your <head> section.
3) You have META data outside (below) your <head> section.

The 'deal breaker' is the double loading of jquery.js. This always breaks things.

As weyboat mentioned, it would be helpful to have your entire theme zipped up and posted here so we can have a look at it's structure.
gerkwil replied on at Permalink Reply
gerkwil
thanks!

i have sent the theme zipped to you and to Weyboat
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
I have sent you a modded version for you to test, let us know how you get on..
mhawke replied on at Permalink Reply
mhawke
I have also done the same. You didn't mention in your PM to me that you had asked weyboat as well. I didn't notice this until I returned to this forum. Perhaps next time you can request help from only one person at a time so that we are not duplicating each other's efforts.
gerkwil replied on at Permalink Reply
gerkwil
Hi Weyboat,thank you so much for helping me,
I have uploaded your entire zipfile, unfortunately it does not resolve my problem, the blocks are still not deleting.
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
I added your modded theme to a new install on my dev server (wamp) and I found I could add blocks and delete them with no problems?
mhawke replied on at Permalink Reply
mhawke
Some questions... Could this be a permissions thing?

Are you using Advanced Permissions?

Are you logging in as the SuperUser or just a member of the 'Administrators' group.

Check your server logs for any errors.

Check "Dashboard->System and Settings -> Logging Settings" to make sure you are logging errors.

Check "Dashboard->System and Settings -> Debug Settings" to make sure you are showing errors on the page and not hiding them.

Before you try to delete a block, right-click on the page and choose 'Inspect Element' and look at the 'Console' tab for any errors.

After you try to delete a block, right-click on the page and choose 'Inspect Element' and look at the 'Console' tab for any errors.

After you delete a block, right-click on the page and choose 'View Source' to see if there are any 'fatal' PHP error messages buried in the page, probably near the bottom.
gerkwil replied on at Permalink Reply
gerkwil
i will look into this, thanks!
gerkwil replied on at Permalink Reply 1 Attachment
gerkwil
Can it be this error? it says jquery...
gerkwil replied on at Permalink Reply
gerkwil
Hi Both, thanks so much for helping me and sorry if i was unclear about you both helping me with the theme. Both the versions you have modified did not do the trick. Ik think it is best to do a new C5 install, perhaps it is somethings els i've f*ck#ed up...

I am very greatfull to both of you but if Weyboat has no problems deleting blocks it must be something outside of the theme that is breaking down. I will use your tips on my theme to make it better and i will keep you posted after i installed c5 again.

thanks again!
gerkwil replied on at Permalink Reply
gerkwil
Hi Weyboat,

I made a copy of the full site and database and cloned it on a diffirent URL. No Problems, able to delete evnery block. So i deleted the root site and made a new clone from the other url back to the root.

Bur when the new clone was placed on the root site again, the block wouldn't delete anymore... very strange.

At last i know now that i have to make a fully new install of C5.

Thanks for your effort in helping me out.
mhawke replied on at Permalink Reply
mhawke
Check the permissions on your root folders. I believe most of the folders need to be set to 755.
gerkwil replied on at Permalink Reply
gerkwil
Thanks again!

But the problem was relativily easy... The .htacces had an interfering rule that blocked deleting te blocks. So i edited the htaccess and now it suddenly works...