Blocks disappear when moving from left to right.

Blocks disappear when moving from left to right.

by W Page -
Number of replies: 13
Hello!

When I move a block from left to right the block I was trying to move disappears and therefore does not appear on the right.

What could be causing this??

WP1

Average of ratings: -
In reply to W Page

Re: Blocks disappear when moving from left to right.

by Gustav W Delius -
Is the block, after it disappears, listed in the Blocks Add... drop-down list? For me blocks sometimes disappear like that when the arrow icon is just underneath the delete icon and I am a bit off with my mouse click.
In reply to Gustav W Delius

Re: Blocks disappear when moving from left to right.

by W Page -
Hi Gustav,

The "Drop Down" List Block is not on the page at all. It has been missing actually since the upgrade to v1.3. I am having other problems after the upgrade as well. See

"500" error after updating - may be Calendar Problem??
http://moodle.org/mod/forum/discuss.php?d=7683

and

Problems upgrading site - Please Please Help!!!!
http://moodle.org/mod/forum/discuss.php?d=7804

This may be connected to those problems.

I have been waiting for a response from the webhost, 1and1.com, about the 500 error. 
1 and 1 does not provide error logs so it is not possible to find oot on my own what is causing the 500 error.  I think I better not hold my breath on that response however.  sad

I would really like to know what is causing this upgrade problem.  Although it does not happen all the time, it happens enough to be a real bother.  Also, I am getting weary of having to have to delete the website and the database and then reinstall them in order to get rid of the problem.

WP1
In reply to W Page

Re: Blocks disappear when moving from left to right.

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
I'd also like to know what the cause is for this, W ... until I hear of any others with the same problem, though, my best guess is that it's something unusual on that 1and1 server (especially given earlier reports of wierd 500 errors at the same ISP).
In reply to Gustav W Delius

Re: Blocks disappear when moving from left to right.

by Jay Melton -
Never mind (said with a Rosanna Danna voice). I've just found out where the settings are.

Jay
In reply to W Page

Re: Blocks disappear when moving from left to right.

by van herbruggen geert -

Hello

I'm heaving the same problem. When I move a block from Right to Left it disappears.
It appears in the add blocks list (as it were deleted)

Geert

In reply to van herbruggen geert

Re: Blocks disappear when moving from left to right.

by Gustav W Delius -

Does this happen every time you move a block from left to right? Does it happen also when moving from right to left? Does it happen with all blocks?

In reply to Gustav W Delius

Re: Blocks disappear when moving from left to right.

by van herbruggen geert -

Hello

I just upgraded to the stable version of moodle 1.3

I can add 1 block, then it appears on the right side. When I move it to the left side, it disappears. Then, the name is still in the list, like I deleted the block.

I run EasyPHP on a windows machine. Has it got to do withe this maybe ?

Geert

In reply to van herbruggen geert

Re: Blocks disappear when moving from left to right.

by Chad Parmentier -
I know this forum is old, but I just installed the latest version of 1.9.3+ and cannot move blocks from right to left. They do not disappear from the drop down list the block just acts as though it was deleted.
In reply to Chad Parmentier

Re: Blocks disappear when moving from left to right.

by Ann Adamcik -
Do you have any pinned blocks (aka sticky blocks)? If so, they can sometimes cause other blocks to disappear when you try to move them. See MDL-11131.
In reply to Ann Adamcik

Re: Blocks disappear when moving from left to right.

by Chad Parmentier -
Thanks for the reply, I seemed to have fixed the blocks problem but I never was able to recover the resources block that appears on the front page. When I moved it right it disappeared. I think I read somewhere others having a similar issue.I deleted all sticky blocks a while back.
In reply to Chad Parmentier

Re: Blocks disappear when moving from left to right.

by Valery Fremaux -

Hi All, I've found a silly bug that was resulting in same effect :

The fix is :

in lib/blockslib.php

function blocks_get_by_page($page) {
    $blocks = get_records_select('block_instance', "pageid = '". $page->get_id() .
                "' AND pagetype = '". $page->get_type() ."'", 'position, weight');

    $positions = $page->blocks_get_positions();
    $arr = array();
    foreach($positions as $key => $position) {
        $arr[$position] = array();
    }

    if(empty($blocks)) {
        return $arr;
    }

    foreach($blocks as $block) {
        // very important fix. Fixes lost blocks in flexipage and front page format
        // renumbers the duplicate weights in order...
        while (array_key_exists($block->weight, $arr[$block->position])){
            $block->weight++;
            update_record('block_instance', $block);
        }
        $arr[$block->position][$block->weight] = $block;
    }
    return $arr;
}

Maybe it has something to do with the error you're experimenting. It fixed all weird behaviour definitively in our instances. I'll seek for a tracker entry... may help.

Problem is that some block moves do not calculate correctly the weight of the landing block, and weight duplicates appear in database. This fix recalculates dynamically the weights of the blocks in the page so they are in correct order, and no one is forgotten. Beware : you may have some ghosts reviving !! wink

Cheers.

In reply to Valery Fremaux

Re: Blocks disappear when moving from left to right.

by Chad Parmentier -
I tried editing blocklib and it caused the entire site to only display a white page. I will post a copy of my blocklib.php maybe I made a mistake in the code. any help would be appreciated!

P.S. The resources block and the calendar block are the only blocks missing from what I can tell.
In reply to Chad Parmentier

Re: Blocks disappear when moving from left to right.

by Chad Parmentier -
I tried it again and it seemed to have no effect. i must have had a character mistake in blocklib.php before