Update a block with code

Permalink
Hi,

I'm trying to update the content of a content block with php code in the dashboard. I'm using the save-function of the ContentBlockController class for this. The update seems to work, because when I check the database table btContentLocal I can see the changes. But when I watch the page with the updated block I do not always see the changes. Also when I try to load the content in my update form I don't see the changes.

What is the problem here? Does it have something to do with block caching? Or with page approval? I can't find it. Please help me.

Ronald72
 
Ronald72 replied on at Permalink Reply
Ronald72
Perhaps this can help:

A dump of the block on the front of the website.

Array
(
    [0] => Block Object
        (
            [cID] => 147
            [arHandle] => Main
            [c] => Page Object
                (
                    [cID] => 147
                    [attributes:protected] => Array
                        (
                        )
                    [error] => 
                    [pkgID] => 0
                    [cPointerID] => 0
Ronald72 replied on at Permalink Reply
Ronald72
As you can see if you look closely the page object in the block and in the area are different (the attribute news_body). How is that possible?
Ronald72 replied on at Permalink Reply
Ronald72
And another strange thing: When I watch the page in the site I see old text and when I try to edit that text in the page I see the new text in the editor. ???

This website stores cookies on your computer. These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media. To find out more about the cookies we use, see our Privacy Policy.