When I delete ddblocks, they disappear from the list but they are still around. The Dynamic Display Block lists are empty (I deleted the two old ones), cleared server and client caches, made sure the blocks don't appear on the Block configuration page, yet the Basic block is still showing up on the front page where it was before.

Do I need to clear it in the database? If so, how do I do this?

I used the contextual link on the block as it appeared on the front page and the "basic" block edit page appeared. I changed the title and Saved. The block then disappeared from the front page and only the error:

    *  Notice: Undefined index: 1 in ddblock_get_block_title() (line 2555 of /home/mysite/public_html/drupal7/sites/all/modules/ddblock/ddblock.module).
    * Notice: Undefined index: 1 in ddblock_get_blocks() (line 251 of /home/mysite/public_html/drupal7/sites/all/modules/ddblock/ddblock.module).
    * Notice: Trying to get property of non-object in ddblock_content() (line 1695 of /home/mysite/public_html/drupal7/sites/all/modules/ddblock/ddblock.module).
    * Notice: Trying to get property of non-object in ddblock_content() (line 1697 of /home/mysite/public_html/drupal7/sites/all/modules/ddblock/ddblock.module).
    * Notice: Trying to get property of non-object in ddblock_content() (line 1698 of /home/mysite/public_html/drupal7/sites/all/modules/ddblock/ddblock.module).

remains each time I reload the front page.

Browsing through the database (like a bull in a china shop) I noticed that the table "Block" has four entries, two for each of the old ddblocks, including the "basic" block with the changed title.

Comments

steveray’s picture

block table contains these lines:

INSERT INTO `block` (`bid`, `module`, `delta`, `theme`, `status`, `weight`, `region`, `custom`, `visibility`, `pages`, `title`, `cache`) VALUES
(37, 'ddblock', '1', 'bartik', 1, 0, 'featured', 0, 1, '<front>', 'This block should be deleted', -1),
(38, 'ddblock', '1', 'seven', 0, 0, '', 0, 1, '<front>', 'This block should be deleted', -1),
(39, 'ddblock', '2', 'bartik', 1, -10, 'header', 0, 0, '<front>', '<none>', -1),
(40, 'ddblock', '2', 'seven', 0, 0, '-1', 0, 0, '<front>', '<none>', -1);

Where 'This block should be deleted' is the new title I gave the block.

...also noted: table ddblock_block is empty.

divan’s picture

I have the same problem.

steveray’s picture

If I add a new "basic" block with a block name I've not used before and then click Edit on that block, I get the old "basic" block with the 'This block should be deleted' title and modified settings.

If I add a second "basic" block (I've never had more than one before) it is created with all default values.

ppblaauw’s picture

Category: support » bug
Status: Active » Needs review
StatusFileSize
new1.28 KB

Patch to fix deleting of blocks

steveray’s picture

I patched the file and tried deleting the old ddblocks.

The two rows for each were deleted (bartik and seven) but a new row for each in the block table was added with the "seven" theme and with the title field blank. They were never enabled in the "seven" theme.

I created a new basic ddblock and then deleted it and saw the same behavior.

I noticed that views is adding a new row to the block table during some of these delete operations.

That's all the debugging I've got time for right now; I wanted to give you what feedback I had, even if incomplete.

steveray’s picture

When I added the new block, it took its own new delta and didn't re-use a delta from a previously "deleted" ddblock.

ppblaauw’s picture

StatusFileSize
new1.48 KB

@Steveray
thanks for testing

Probably the _block_rehash() function has to be called before deleting the rows so no new rows are added after the delete.

New patch attached.

W32’s picture

I have the same problem.

ppblaauw’s picture

#8 after applying the patch from #7 you have the same problem?

steveray’s picture

#7 patch seems to work at removing the ddblock rows and no additional views row is added.

I've noticed that the title I add on the block configuration page doesn't stick on the first save but does if I retype it and save again.
Not sure if it's related, I'll create a new issue on this.

ppblaauw’s picture

Title: Can't delete DDBlocks » Can't delete DDBlocks (Fixed)
Status: Needs review » Fixed

committed to cvs

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.