I was getting this notice in beta3 so updated to dev, but the issue remains. I can't reproduce the problem on this installation as I'm real short on time right now but i'll come back to it. Can't find anything similar in search.
As far as I remember, I had cloned a view and changed the offset value of the pager.
Notice: Undefined offset: 1 in views_block_view() (line 591 of /sites/hosts/sitename.com/htdocs/sites/all/modules/views/views.module).
Line 591 is inside this function: function views_block_view($delta) {
...
591: list($name, $display_id) = explode('-', $delta);
Cheers
Comments
Comment #1
dawehnerWe had this error before and fixed it in dev some time ago.
If you say you can't reproduce it, we can't either :)
Comment #2
paulskinner commentedI've removed, disabled and then deleted all views related to this page, I've cleared the Views Cache.
This Notice isn't appearing on any other part of the site except the one page.
Is there any other step I could take to get rid of the Notice to start with so that I can try and reproduce? Worried that I'll lose my other views if I uninstall the module?
P
Comment #3
paulskinner commented@dereine
I found the error that you mention: http://drupal.org/node/1013666 ?
I fixed the error by removing some stale entries in my blocks table as that thread mentioned.
I still cannot reproduce the error in 7.x-3.x-dev. I'll downgrade to beta3 to try again in there.
Should this be marked as duplicate? Perhaps not until I've got clear steps to reproduce.
Comment #4
paulskinner commentedJust reproduced this in dev by deleting an existing view and block, and creating a new one with the same machine names.
in 7.x-3.x-dev
Comment #5
dawehnerCool so please describe us how to reproduce it.
Comment #6
esmerel commentedComment #7
nagiek commentedComment #8
nagiek commentedJust wanted to add that I am getting the same error. However, the error lay dormant for a while and I'm not sure what triggered it. I did not upgrade any module between today and yesterday.
Notice: Undefined offset: 1 in views_block_view() (line 614 of /sites/all/modules/views/views.module).
I think the steps to reproduce are
add a view machine_name_x as a block and make it visible (my view takes an nid as an argument.)
delete view machine_name_x
recreate view machine_name_x as a block and make it visible in the same location
move view machine_name_x to a different location.
May be that the problem lies in there? The message appears on each page of the site, probably because the view is not restricted to only appear on node/%nid pages.
Using 7.x-3.x-dev.
Comment #9
dawehnerTryed to reproduce this issue with a view called "block" but it worked fine.
@nagiek
Can you look into the block table and see how the id of this blocks looks like? Is it a md5 hash?
In general line 614 seems not be the current git version, but this probably doesn't matter
Comment #10
paulskinner commentedwhen I had this issue it definitely appeared as an MD5 hash.
Comment #11
nagiek commentedYeah, appearing as an md5 hash in the delta column.
I also wanted to say that my earlier reproduce steps don't work and I have a hard time reproducing the error. Sorry I'm not more help.
Comment #12
mesr01 commentedHi. Just in case it helps someone: I had a similar issue (although on line 623, maybe not exact same version of views). What happened is that a display got corrupted. I could not delete it from the interface so I deleted the row in the 'views_display' table. However, there was still a corresponding entry in the 'blocks' table, which was apparently giving me the error. I solved the issue by simply manually deleting that entry.
Comment #13
vthirteen commentedfor what it's worth, in my case a module created through views as a block display was deleted, yet in the block table in the database was still existing with a "1" status (=block enabled). setting it to 0 fixed the problem, or at least made the notice disappear. now, i wonder why that block is still there if its views display does not exist any more.
Comment #14
thinkluke commentedI get this issue whenever I change the machine name of a view... any fix coming out soon?
Comment #15
sharky999 commentedI'm linking mine own version that was closed as duplicate of this one: #1223624: Notice : Undefined offset: 1 in views_block_view().
Also, when I was trying to checking up the database as per #13, I found some other strange behaviour that I created a ticket for it: #1224706: Changing a block name or machine name cause random reaction in the database. Maybe it's the cause behind all of this.
I've updated to the dev version of 2011-july-19 and the notice is still there.
I've also checked the database and there was a lot of old blocks that I deleted some time ago in the table ([drupal]_block... Some are active (status=1, and still set in a region). Some have humand readable delta, other MD5ish delta...
Also, I should have 3 views block in my second sidebar, but in the database there is 8 of them! Same thing in the content, I should have 6 of them, but there is 8 of them in the database. And for the deactivated one, I should have only 1, but there is 6 in the database! Basicly that make 12 blocks are in the database but deleted from my views!
I'm doing a clean up right now, but it seem pretty much all I can say for now. If something else come up, I'll update this ticket.
Comment #16
sharky999 commentedI can confirm that after deleting all blocks made by views in {prefix}_block table that was not linked to anything in views the notice disappear. So I guess, that mean a solution would be to keep the table clean of all the strange things that can happen as I described in #1224706: Changing a block name or machine name cause random reaction in the database and others I haven't seen.
Comment #17
sharky999 commentedComment #18
dawehnerHere is a patch which fixes the notice, but doesn't fix the problem, because it's impossible to reproduce it at the moment.
Comment #19
dawehnerThis version of the patch fixes the notice and fixes the actual problem as well.
Please test it.
NOTE: This patch hides old wrong values. So it can't rebring you old blocks, so please test it with new views/blocks.
Comment #20
sharky999 commentedI've just tested the patch.
What I did for testing is this:
In each of those Views (well, most of them as I try to not break my prod. environnement) I did this:
From what I've seen, the notice doesn't show up anymore. However, I was looking at the database at the same time, I've noticed this thing. I think these might lead to the notice (or another one) or other errors in the future.
I leave the needs review for other people to test. I the mean time, I'll update to the 2011-july-20 version of dev.
Comment #21
dawehnerYeah this triggers a block_rebuild. I think you don't need the blocks, unless you want to configure the blocks. Does this makes sense?
That's how it should be. Perfect
That's from my perspective somehow hard to fix, because this old blocks aren't known anymore for views.
What it could do is to manually delete it from {block} when a view is deleted. That's a bug from my perspective of block_rehash.
See above.
Thanks, really thanks for this great review! All people here should model oneself on you!
Comment #22
somatics commentedI hope I'm not just lumbering into this, but on the issue I posted, I was told that my issue appears to be similar to this one. My issue is at http://drupal.org/node/1227904 . I've read the postings here and for some reason it's going a bit over my head. Here's the problem I'm seeing:
Is this problem related and is there a fix for it?
Comment #23
sharky999 commentedFor #22,
The problem doesn't look related, but with the symptom you describe it looks like the solution will be related.
If you can do again your cloning using the last dev version and watch in between each step the changes in your database in the table {prefix}_block (and maybe also in the tables related to Views, which I don't remember by heart the name). The first two step to watch the changes would be:
After that, do whatever step you think is necessary to setup your cloned view and watch for any changes in the tables. I think the most important columns to watch are bid and delta.
bid: Look closely if there is any entries with the same delta, but different bid for a single theme.
delta: Look closely if it's a machine name or MD5 and for any changes.
PS: If you're using phpMyAdmin for watching the tables, use the research options and set module LIKE views and theme LIKE {name of your theme}. It will help to only watch the block affected by Views and on your current theme.
Once you've done that, if you can report your step and the thing you have noticed that seem odd or not working properly, just answer here! :)
Comment #24
sharky999 commentedOn #21,
Yes, this makes sense. I'm not used yet to all the way of Drupal is doing stuff (but I noticed that there is a lot of *_rebuild stuff around!) it seem! ahah
Hum, I'm wondering, when you say "old blocks" do you mean deleted/disabled blocks (either directly or recursively by the View) or blocks created by older version of Views (like 7.x-2.x-dev or "last week dev version in 3.x-dev") but still active?
I'm asking because you answered that on a part (However, this seem to doesn't affect block created with older version of Views, which keep the {viewName}_{blockMachineName}.) that was applied to a block that is still very active and working in Views, so it's kinda strange to say that those blocks aren't known anymore for Views, but are still working and I can modify them, etc.
Although the answer makes sense if applied to the two last quote, corresponding to deleted/disabled blocks.
Comment #25
annikaC commentedI'm having exactly the same issue as somatics.
Comment #26
dawehnerWell but the error shouldn't exist on this kind of blocks?
Because the index is only then not existant if it's unknown to views...
Comment #27
dr18 commentedPretty new to Drupal. I hope this can help someone.
I had this error (notice) but the line reported was 623 in my case. It happened when I changed the machine name of the block. The problem was in that I also had a mini panel containing this block. When I reverted the machine name to previous value, the notice had gone. Then I removed the block from the mini-panel, changed the machine name of the block and reassigned the block into the mini-panel.
Obviously, mini panels link to containing blocks by their machine names and are not updated when they change. Maybe a Panels module issue?
If you get this error, try checking whether your block that should appear instead of notice message is referenced in some other part of your site.
(Drupal 7.7, Views 7.x-3.0-rc1, Panels 7.x-3.0-alpha3)
Comment #28
bhosmer commentedI'm having this issue as well. I deleted some content that made up a view.
I looked through my block table and can't find any md5 hashed values.
Are there any other solutions any one can think of? Mine is also on line 623
Edit:
I should have read the replies a little better, there actually was an MD5 hashed value in my block table under delta.
Comment #30
dawehnerJust commited the patch as this fixes a somehow quite major bug.
Please create a new issue if there are new bugs on this topic
Comment #32
develway commenteddereine
Thanks, this patch works fine for my problem "Notice: Undefined offset: 1 in views_block_view() (line 623 of views.module)"!!!
Comment #33
Andy1966uk commentedDo I use drush and enter the patch in the command line ?
Comment #34
bhosmer commented@Andy1966uk check this guide out for information about how to apply a patch: http://drupal.org/node/707484
Comment #35
site1 commentedI was just having this issue also. I was adding a new view for a RSS feed when I received the following error message: Notice: Undefined offset: 1 in views_block_view() (line 623 of.......
Solution: Delete the views you created and then create a new block view. After you create your new block view, place it in a block region and then flush the caches.
Let me know if it works.
Good luck!!