I think it would be useful to be able to show a block for each location. If you think this could be useful, I'll write a patch.
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | with warning.png | 22.06 KB | held69 |
| #17 | without warning.png | 21.49 KB | held69 |
| #12 | Picture 1.png | 20.87 KB | jisuo |
| #6 | doubled.PNG | 13.97 KB | held69 |
| #4 | 663108_yr_blocks.patch | 3.32 KB | blackdog |
Comments
Comment #1
tjodolv commentedThis could absolutely be useful to some people, but there would still be a need for letting people just keep all locations in one block. A patch, at least a "proof of concept", would be appreciated. I'm back from traveling, and will be starting on some other issues. If you have the time, feel free :)
Comment #2
held69 commentedAre there any developments on this patch?
Would be great if this patch came out.
I'm not a coder but i would be glad to test things out.
Thanks
subscribing
Comment #3
tjodolv commentedHello there. I have not had the time to work on this yet, but I will, when I get the time. Until then, I appreciate any usable code :)
Comment #4
blackdog commentedHere's a quick proof of concept.
I created a separat function to fetch all locations, creates a block for each location and the default block with all location data. Also changes the theme function to check for a single location, and changes the block output to not show just the credit if the row object is empty.
Comment #5
held69 commentedGreat!
I'll check it out, and report back.
Comment #6
held69 commentedI used the patch and all seem to work very well :)
However there seem to be a little problem, allthough i dont know if this is due to the patch.
When i click the forecast link in the weather block, i get to a page where there is a forecast for coming days, for that location.
Some of the days on that page are doubled or repeated for some reason.(see attachment) ......
This is the case with each forecast page for each location.
Comment #7
tjodolv commentedHello again. I finally have some free time on my hands, so I will look into this today. Strange issue with the duplicated forecast periods, but I'll try to track it down.
Thanks for the patch, blackdog!
Comment #8
tjodolv commentedOk, I've used the concept in blackdog's patch, and added this feature. I also made this an administrative setting, disabled by default. I made it disabled by default, since your block regions can become quite cluttered if you have more than two locations stored.
I have not seen the issue reported by held69 in #6, but please check it out anyway. Might be something else that's causing it.
It should show up in a new dev snapshot within a day. Please test and let me know of any problems :)
Comment #9
blackdog commentedGreat! I'll set this to fixed then?
Comment #10
tjodolv commentedSure :)
Comment #12
jisuo commentedI also get duplicated days, see screenshot. This is using http://website.com/yr_verdata/1
edit: nvm, it might not be a bug at all...
Comment #13
held69 commentedWith succes i have applied the patch under #4.
However when i trie to upgrade to 6.x-2.0 i loose all my weather blocks (per location).
Without result i have tried to apply the patch to yr_verdata-6.x-2.0.
patch fails at line 111,364 and 403.
Help appreciated...
thanks
Comment #14
tjodolv commentedHello there. The blocks are defined differently in the 6.x-2.x branch, and because of that, Drupal's block system "forgets" them when you upgrade. All you have to do is to go to the settings page for the module and activate the multiblocks again (and maybe also re-enable them on the block settings page; if you have a lot of locations with custom settings, you'll have to do a manual backup of the visibility settings and re-apply them afterwards).
Comment #15
held69 commentedThanks for your swift reply.
I have applied the update on a localhost and activated all the blocks.
Indeed i have to re-enable all my blocks (100) and put all the custom visibilitye settings back.
Will take quit some effort.
Would this all be necessary with each upgrade?
The reason for my update were these warnings i kept receiving:
warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity "sites/default/files/yr_verdata/a7d79df259b28b1ef0b6132d58a99dc0" in C:\wamp\www\mysite\sites\all\modules\yr_verdata\yr_verdata.module on line 423
However it looks like i'm still getting these warnings....
Let me know if i should make a different issue for this
Thanks
Comment #16
tjodolv commentedAbout the multiblocks being forgotten, I will try to prevent this problem in future updates.
The warning you get is because the module cannot find an xml file it is looking for. If you have cleared the caches and run cron, but still get the update, you might need to edit the database entry for that location and add
.xmlto the filename. The .xml should have been added when the location was first added, but... Not sure why that happened...Comment #17
held69 commentedIt would be a great time saver updating without the re-enable proces.
Thanks
Clearing caches and running cron didn't take the warnings away.
I have openened the database entries of two locations, one with the error and another without the error.
However they look quit the same.
Where should i put
.xmlin the entry.......Comment #18
tjodolv commentedThis seems very strange. I guess you could try deleting the location and re-adding it. That's not a very elegant solution, and I have to apologize for the inconvenience. I'll try to reproduce the error and see if I can figure out why it happens.
Comment #19
tjodolv commentedHello again. I have not been able to reproduce this error, but I think it may be because I have been sloppy in the past when writing update hooks. The only thing I can do at this point is really to be more thorough with update hooks in the future.
Comment #20
held69 commentedThanx!