Closed (fixed)
Project:
Tagadelic
Version:
master
Component:
Code
Priority:
Critical
Category:
Support request
Assigned:
Reporter:
Created:
7 Dec 2007 at 07:32 UTC
Updated:
29 Mar 2010 at 13:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Bèr Kessels commentedThe patch needs some cleaning:
* Don't mix tabs adn spaces. Use 2 spaces as tabs
* No witespace characters (spaces) at the end of a line please.
* The last item in an array with a comma too, please (line 72 in the patch)
* PLease add the recently added rel=tag to the links
* no spaces between functionname and ().
And why did you remove the caching?
Why do you re-introduce a "more" link? Please do not add new features in a port.
Comment #2
robloachOriginal issue and discussion is here.
Comment #3
jgoldberg commentedAh, oops, I diffed using the release, not HEAD. Here is the new patch.
Comment #4
jgoldberg commentedComment #5
pfaoclePatch didn't apply properly for me (against HEAD from February 11, 2008 - 00:10), plus we need to add
core = 6.xinto the .info file to be able to install the module in Drupal 6. Having trouble accessing CVS at the moment, will try re-roll the patch and test.Comment #6
pfaocleOK, very similar patch from me with .info change included. I'm still having issues with the new menu system (help appreciated - I've probably just missed something obvious), and we can probably take advantage of the new menu item argument wildcards for our chunk/$vid pages.
More when I get time... p
Comment #7
jgoldberg commentedIt has been a while, so here is the latest state of my patch. It should be in sync with HEAD. I've been running it for quite some time with no issues. Looking forward to not being forked anymore. :)
@ leafish_paul, while you have "access arguments" set, you left out the "access callback" for your menu items. Also, you should try to use the t() function to support localization.
Comment #8
pfaocle@jgoldberg: AFAIK, 'access callback' defaults to 'user_access' (see here) and the t() calls are no longer required for the title or description fields (see here).
Aside from that, our patches are almost identical.
Comment #9
jgoldberg commentedAh, you're right. Not sure why your menus aren't working. Can you list your steps to reproduce?
Comment #10
jgoldberg commentedFWIW...
Comment #11
robloachDid a couple things to it:
The hook_menu for the vocabularies should use wildcards and a wildcard loader, but we can move that to a new issue. This looks good to be moved into DRUPAL-6--1.
Comment #12
jgoldberg commentedOn line 358, you have:
Shouldn't it be:
Otherwise, thanks for doing the caching correctly. We missed that.
Comment #13
jgoldberg commentedComment #14
robloachGood find.
Comment #15
jgoldberg commentedLooks good to me. Tested with no problems.
Comment #16
robloachSomeone mind branching to DRUPAL-6--1 and releasing the development snapshot?
Comment #17
pfaoclePatch in #14 looks good, will test properly tomorrow. Minor quibbles as mentioned above, but the 'description' field for the 'admin/settings/tagadelic' menu item doesn't need a t() wrapped round it, and we can drop the
'access callback' => 'user_access',lines from the menu items. Will double check whether it's that which is causing me problems tomorrow. Nice one, all!Comment #18
Bèr Kessels commentedMy comments. Please note that I did not dive deep into the changes for DPL6.
1 - is the init hook optimised? Is that now the preferred place to add CSS? I prefer to have it placed only when required: when building the block contents and/or when building the pages.
2 - Is taxonomy_get_vocabularies not deprecated? used in tagadelic_menu()
3 - IMO drupal 6 has default ways to set the title of a block, can we not (ab)use that, instead of implementing our own? see L 189 etc
Good catch: the $delta = 0 instead of O... :)
Thanks a million so far!
Comment #19
jgoldberg commented@ Ber Kessels
1. Using hook_init is the best practice for adding CSS; if you look at some of the other core modules, you'll see they do the same thing. Now, I believe CSS is always imported regardless of what page you are looking at, which is the same behavior as adding the css in an if (!$may_cache) block. In my opinion, you gain a marginal improvement of performance for an increased amount of complexity, so it is probably better to make a separate patch that people can use if they need that kind of extreme performance requirements.
2. The function didn't change, just the label. See http://drupal.org/node/114774#taxonomy-load
3. Yes, we should do that instead.
@leafish_paul
Like you said, it doesn't make a difference whether or not we have an access callback set. However, we don't really gain anything by not having it either, except maybe a piece of code that is 4 lines shorter. One argument for keeping it in: it might make it easier on a novice user trying to debug if the code is clear about which access callback is getting called. BTW, did you get a chance to try your own code with the callbacks to see if it improved anything?
Attached is a re-rolled patch that includes removing our title form element from the block configuration and the localization function for the description field. It also adds some commenting for hook_init.
Comment #20
robloachThree issues. One major, one nitpick, one minor:
'access callback' => 'user_access'in the hook_menu, but doesn't negatively effect itComment #21
pfaocleCheers for the update. "we don't really gain anything by not having it either, except maybe a piece of code that is 4 lines shorter": suppose not, that's fine with me.
Patch applies fine, seems to working bar a couple of problems. I:
The problems were firstly, only two out of three paths to
/tagadelic/chunk/vidworked (for vids 1 and 3, but not 2). I tried again with new terms/content, to find all of the paths working correctly. Perhaps we really need to get wildcards in for these paths? Or perhaps this was symptomatic of this problem, ie not only are we showing an empty block when there are no posts in the relevant vocabulary, but the more link (/tagadelic/chunk/vid) throws a 404.Secondly, I enabled the tagadelic blocks for the three vocabularies before adding any terms. The blocks remained empty after adding 20 or so terms and it was only when I manually emptied the cache via devel that the terms appeared. Bar the menu/path problem mentioned above, the corresponding
/tagadelic/chunk/vidpages worked OK and showed the correct terms. Also, if I removed all terms, then added 3 more (empty) vocabs, the blocks remained with the old terms listed. Again, emptying the cache remedied this.Adding a new tag to an article doesn't immediately add the tag to the block for the same reason, I guess: something to do with the block cache settings introduced in #11? Incidentally, all the Drupal core cache/performance settings were set to their defaults (off bar gzip).
A tentative 'needs work' then, if anyone else notices anything iffy with caching or paths? Run out of time today, hope this helps.
Comment #22
pfaocleUn-hijacking-Rob's priority change.
Comment #23
robloachHaving the block only update when the cache is cleared is reasonable (this is what I added in #11. This is managed via the block-level caching system, and the cron job which is already part of Drupal. If we have it clear the cache everytime a node is updated or changed, it could potentially really slow down the system. If you read more on block caching, you'll see that we have the best values selected for the job.
This leaves us with the menu problem (implement the wildcard system for the menu), and having the CSS load only when tagadelic is displayed.
Comment #24
jgoldberg commentedCorrect me if I'm wrong, but it seems like loading the CSS only when the blocks display isn't trivial. If caching is enabled, there isn't really a clean way to determine if a block got displayed or not since hook_block($op = 'view') stops getting called. I'm sure there is a way to abuse the core to figure it out, but we shouldn't go down that path.
We could propose adding an extra op to hook_block additional to 'view', which allows operations to be run even if the block is cached. Not sure if we want to go down that path.
Of course, the simplest solution would be to always just include the stylesheet. :)
Anyone care to add some clarity I might be missing?
Comment #25
jgoldberg commentedAttached is a re-rolled patch that includes wildcard handling. Originally, both tagadelic_page_chunk and tagadelic_page_handler parsed the vocs argument themselves:
Here is the new wildcard handler:
Since both tagadelic_page_chunk and tagadelic_page_list share this function, I leave out the NULL edge case and let it get handled in its respective function:
I'm going to mark this patch as ready for review, but veto if you still think there is a way to include the stylesheet only when the blocks display.
Comment #26
pfaocleLooking good, applies, works. Attached is a very minor revision (tabs -> spaces).
So:
* CSS loading problems - shall we move to another issue?
* Block caching options seem reasonable, behaves as expected AFAI can see.
* Wildcards/callbacks seem to be working.
Probably OT here, but after playing around with this module a bit more, I've noticed some inconsistencies in the menu items, for example: a page not found is shown for
/tagadelic/chunk/1when there are no nodes to display, but with/tagadelic/list/1we see a page with the vocabulary title and description... anyways, that's probably better here.Should get time to test some a D5->D6 update with tagadelic over the weekend.
Comment #27
jgoldberg commentedProbably OT here, but after playing around with this module a bit more, I've noticed some inconsistencies in the menu items, for example: a page not found is shown for /tagadelic/chunk/1 when there are no nodes to display, but with /tagadelic/list/1 we see a page with the vocabulary title and description... anyways, that's probably better here.
I just tested that in Drupal 5 and the same result occurs.
This patch shouldn't be focused on upgrading to 6 AND solving every defect out there. We should just get a first release out before we start worrying when the stylesheet is included, what happens if list/5 has no nodes, etc.
Comment #28
Bèr Kessels commentedjgoldberg and leafish are correct: We should not try to solve bugs here, just upgrade to 6. Debugging is done after that.
so here is my list:
1- leave the CSS loading where it was.
2- leave any 404s readmores and so forth the way they were, even if you consider them broken.
Lets try and make this patch as small and focused as possible.
Comment #29
jgoldberg commented@ Bèr
The #26 patch meets those two requirements. So, as long as no one is running into any regressions, we should be good to go. Can someone else out there take it for a spin before we mark it RTBC?
Comment #30
add1sun commentedI just did a quick run through on this on my newly upgraded site.
Used tagadelic HEAD and applied the patch in #26. I enabled the "Tags in tags" vocab block and worked fine. I then went in and configured the block to show up to 50 tags. When I saved that change my block title (the default one it had) disappeared. So something about setting the default block title isn't set quite right. I don't have time to poke around right now, just wanted to give a heads up on a minor issue.
Other than that it seems to be working fine in my cursory review.
Comment #31
pfaocleCan easily reproduce add1sun's problem. Shouldn't we be inserting the default 'Tags in vocab' title into the block configuration form (under
$op == 'configure')? Otherwise our'tagadelic_block_title_'. $deltavariable will be empty, the default won't get used and our block titles will also be empty.Comment #32
jgoldberg commentedRe-rolled a new patch that fixes the issue brought up in #30. Thanks for finding that add1sun.
Comment #33
Bèr Kessels commentedpatch in #32 looks alright, from the outside. I do, however, want some testresults before putting it out in the wild. Can someone run this on an existing environment (with tags) and on a clean one?
Comment #34
limitedability commentedCan someone please post a patched archive? I'm having trouble patching it myself. It's patching but giving errors on several lines. I've tried it on the latest official build and some past builds, and each one is giving me errors.
Thanks.
Comment #35
add1sun commented@limitedability, you need to patch against HEAD, not the latest release.
Comment #36
pfaocle#32 has fixed the block title issue here, nice one. Running this on clean dev/test Drupal 6 site at the moment without problems (so far). Haven't had chance to try a 'real' update yet.
Comment #37
robloachThe issue with the custom CSS code having to be in hook_init() will have to wait until we have custom CSS and JS files for cached blocks. Until then, this is the only solution available.
I've quickly gone through #32 and it seems good. I think we should commit this, and then branch it to DRUPAL-6--1.
Comment #38
jgoldberg commentedBèr would like one more positive test result before putting out a stable 6-x release. Anyone else who could help would be highly appreciated.
Comment #39
DenRaf commentedI can confirm a positive test. However I would suggest to make one little change.
After applying patch: tagadelic-198672-16.patch from post #32 I suggest this:
In tagadelic.module change line 231:
from: cache_set($cache_name, $tags);
to: cache_set($cache_name, $tags, ‘cache_page’, CACHE_TEMPORARY);
This way are the change you make in your content and tags, way faster updated in your tagcloud.
Comment #40
jgoldberg commented@ DenRaf
While I think there is a good case for using CACHE_TEMPORARY rather than the default value CACHE_PERMANENT (which requires calling cache_clear_all with the explicit cache name for tagadelic in your cron.php), at this point we are only trying to reproduce the 5-x behavior, which uses the CACHE_PERMANENT constant. We should open a ticket for this question though (perhaps give the user the option in the admin panel).
Thanks for reporting a positive test result.
Comment #41
zilla commentedhello, sorry to sound like such a nube here but i'd really like to try tagadelic in a new d6 install but do not know how to apply patches to the module directly...is there a link to a most currently patched version or a simple explanation of how to download the most recent patch (in 32 above) and apply to the download full mod from the mod directory ?
Comment #42
jgoldberg commentedCheck back within the next few days, a release should be coming soon.
Comment #43
zilla commentedthanks! happy to test the release and report back and bugs or conflicts with other modules etc...
Comment #44
Bèr Kessels commentedI'd like one more -or so- positive test before I will release a stable. If none come in befor etomorrow, I'l try to release a beta before the weekend.
Comment #45
stefan vaduva commentedI've also tested it with Drupal 6 and I don't have any problems.
Comment #46
Anonymous (not verified) commented+1 on this, works great.
Comment #47
Anonymous (not verified) commentedCleaned up the code a bit to comply with coding standards.
Comment #48
WorldFallz commentedJust tried this patch-- failed on hunk 1 (the .info file) against the current HEAD. I've attached the reject file in case that can be of an use. I fixed the .info but I've no idea how to patch a patch, lol. It's also attached in case that can be of any assistance. Thanks for the d6 port of this most critical module!
Comment #49
add1sun commentedHm, well the patch in #47 applies just fine for me against HEAD checked out from CVS. Your file looks like it has the packaging script additions in it, i.e. that it is from a tarball and not the CVS repo, so I am assuming that is why you get a fail since the patch assumes a "clean" info file from CVS and does not take into account the stuff that d.o adds while packaging.
So, basically, I'm saying that the patch is fine.
Comment #50
WorldFallz commentedah... I wasn't aware it made a difference. Thanks for the info. From now on I'll get the files to patch from cvs.
Comment #51
jgoldberg commentedI didn't have any problems with the patch in #47. I looked at the changes and all of them are just spacing adjustments. We should be good to go without any new testing (although, of course, more testing is perfectly fine.)
Comment #52
zilla commentedhello. just reading this last comment (51) and wondering if the patch has been rolled into a new or current drupal 6 dev version or beta version...any status update appreciated.
Comment #53
robloachhttp://drupal.org/cvs?commit=103421
I've committed the patch to HEAD and then moved it to DRUPAL-6--1. Any more issues and patches regarding the Drupal 6 port will have to be made from DRUPAL-6--1. I've create the 6.x-1.x-dev development snapshot release, as well as a 6.x-1.0 release of Tagadelic. Thanks, everyone, for the help on this!
Comment #54
zilla commentedthanks! just downloaded and putting up within seconds...
Comment #55
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #56
princedudley commentedCan't anybody organize all the patches and fixes into an orderly manner and then post it?
Its very confusing to see one here and another one somewhere else.
Without proper explanition and instructions, the patches are as good as nothing.
There should be versioning even for the patches!!!
Comment #57
WorldFallz commented@princedudley did you not read the entire thread? See #53.