Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have found in logs that path tagadelic/chunk/images/x.gif gives a warning:
implode() [function.implode]: Argument to implode must be an array. в файле /home/..../sites/all/modules/tagadelic-6.x-1.0/tagadelic.module в строке 212.
To fix this change:
function tagadelic_get_weighted_tags($vids, $steps = 6, $size = 60) {
//Fixing a bug with wrong path. Start
if (!is_array($vids)) $vids=array();
//Fixing a bug with wrong path. End
Comment | File | Size | Author |
---|---|---|---|
#18 | 272966-17.patch | 575 bytes | kalman.hosszu |
#2 | tagadelic_272966.patch | 748 bytes | vladimir.dolgopolov |
Comments
Comment #1
vladimir.dolgopolov CreditAttribution: vladimir.dolgopolov commentedMy opinion here is just return an array() instead of $vids = array();
Why should we read from the cache wrong data?
Comment #2
vladimir.dolgopolov CreditAttribution: vladimir.dolgopolov commentedHere is my patch.
It against module's HEAD.
Comment #3
Bèr Kessels CreditAttribution: Bèr Kessels commentedCan someone please test this patch?
I like its concept, and like the solution, but need at least one more person to confirm it works and does not break his/her site.
Comment #4
brainlock CreditAttribution: brainlock commentedI didn't apply the patch, but made the code change and now receive a "Page Not Found" error, which is acceptable since no tags exist yet.
Comment #5
vladimir.dolgopolov CreditAttribution: vladimir.dolgopolov commentedYou should clear the cache IMHO.
Comment #6
Bèr Kessels CreditAttribution: Bèr Kessels commentedif cache is causing this, then we need to implement this in the patch: we should clear the cahce in hook_update, in that case.
Comment #7
Bèr Kessels CreditAttribution: Bèr Kessels commentedpatch should implement a cache wipe in the update, else people get warnings.
Comment #8
rkdesantos CreditAttribution: rkdesantos commentedI am seeing a similar error in v5:
Message implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in /home/..../modules/tagadelic/tagadelic.module on line 208.
Comment #9
rkdesantos CreditAttribution: rkdesantos commentedI'm interested in getting a fix against D5 but has this ever been fixed against either D6 or D5?
Comment #10
Bèr Kessels CreditAttribution: Bèr Kessels commentedIMO we should travers up the calling functions and fix it in the first place: simply make sure we never call the function tagadelic_get_weighted_tags without an array if vids!
Comment #11
ilfelice CreditAttribution: ilfelice commentedSubscribing
Comment #12
rkdesantos CreditAttribution: rkdesantos commentedAny action to address this issue?
Comment #13
Bèr Kessels CreditAttribution: Bèr Kessels commented@jorgemare instead of subscribing and spamming us with updates, you could actually do somthing about it :)
@rdesantos: see #10. Maybe you can address it?
Comment #14
rkdesantos CreditAttribution: rkdesantos commented@Ber Kessels: If I had the necessary knowledge or skills I'd be happy to do so. Unfortunately I don't think I do. My question was an inquiry on the status and that's all.
Comment #15
Bèr Kessels CreditAttribution: Bèr Kessels commentedClosing "needs work" that has been open for a long time, without anyone working on it.
Comment #16
Bèr Kessels CreditAttribution: Bèr Kessels commentedComment #18
kalman.hosszu CreditAttribution: kalman.hosszu commentedA new patch is attached. This solves the problem on my environment. Would somebody test it?
Comment #19
rkdesantos CreditAttribution: rkdesantos commentedThe equivalent patch seems to be good in V5 as best as I can tell. Will test V6 later and advise.
Comment #20
Bèr Kessels CreditAttribution: Bèr Kessels commentedThanks for the patch and the test. I'd like a confirmation about how it works on d6.
Also, if you are familiar with Github, consider sending a pull-request there: that is a lot less work for me and the other maintainers to merge, review and test. It will speed up acceptance of a patch enormously.
About the patch:
As I said in #10:
» IMO we should travers up the calling functions and fix it in the first place: simply make sure we never call the function tagadelic_get_weighted_tags without an array if vids! «
This is addressed just fine, thanks!
But, this introduces a so-called "early-return" which, in the already horrible factored (sorry, my fault) code makes it harder to follow and debug. All in all: I'd very much prefer a solution that solves this by refactoring a little more. I've done a quick refactoring of this method, which may be an example: https://github.com/berkes/tagadelic/commit/3ded2f6a20393afe2be67435cadc1...
Bèr
Comment #21
rkdesantos CreditAttribution: rkdesantos commentedI've tested v6 and it appears to be ok with the patch.