Closed (fixed)
Project:
Related links
Version:
6.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Task
Assigned:
Issue tags:
Reporter:
Created:
16 Feb 2008 at 19:47 UTC
Updated:
2 Jan 2014 at 23:45 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Zen commentedIf you have the time, please update your patch against 5.x.2.x-dev. Much appreciated - thanks!
Comment #2
hswong3i commentedPatch via latest 5.x.2.x-dev, code clean up with coder.
Able to install required tables, access/update setting pages.
Still need works and input.
Comment #3
mehlvogel commentedHi,
I've applied the patch and checked it, but got some problems which I was able to fix:
1. The path to the relatedlinks.js file was wrong and so file_get_contents() threw an error. The path used was "/modules/..." (note the leading slash, which makes this path an absolute one (at least on a *nix system)). I've added a "." in front of it, thus making it a relative one. I don't know which impact this change has, so someone will review this, I could only say, that this works for me.
2. The theme_relatedlinks() method was not registered, I've fixed this.
I'll append a patch file against the patched source tree. Maybe this is usefull to you, or to other people.
Edit: I have issues using the add manual links thingy while editing a node (everytime I edit a node, the links get changed (even if I don't edit them)) and broken.
Stephan
Comment #4
Zen commentedAre you missing some files in your patch, mehlvogel?
Thanks,
-K
Comment #5
mehlvogel commentedHi,
hmm I don't think there are missing files. But as I've solved my problem from above and added some functionality I needed, I'll just try to append a new patch file. Tell me whether you have problems with it as I'm not very experienced in using the diff program, so hopefully the patch file is useable.
I've appended a patch against 5.x.2.x-dev. It should completely contain the patches posted above and the following additions:
- Corrected the RegEx used to parse the text area in the relatedlinks.js, as the old one has divided a URL by chars like '://' in my Firefox 3 and thus breaking the links when editing a node (as I'm not very experienced in using Javascript, this may cause problems on other browsers).
- Added support for multilingual environments, by only showing discovered nodes of the same language (this behaviour may be disabled in the admin section).
- Fixed the path in relatedlinks_form_alter() as described above.
- Fixed the call to _relatedlinks_taxonomy_select_nodes() in _relatedlinks_get_discovered_links(). The parameter count wasn't correct.
- Fixed the theme hook as described above.
I hope, my changes are useful for you.
Stephan
Comment #6
Zen commentedStephan,
While I do appreciate the changes, it would be best if this issue deals _only_ with the D6 port - no bug fixes and no new features please. Those will need to be spun off into separate issues with separate patches and at the present moment, for D5 unless they are D6 related features.
Thanks again. I'm going to be AWOL for a bit, but I'll check back later.
-K
Comment #7
mehlvogel commentedHi,
allright :), if I'm doing some more changes to that plugin, I'll keep that in mind. So I think, the part related to D6 is completely in my first patch file, if I've forgotten something you need, tell me.
Stephan
Comment #8
cutv commentedIs there any news on a timeline for this project? The last post was two weeks ago.
Can anyone suggest any alternate modules/techniques that can achieve a similar functionality in D6?
Comment #9
coltraneI applied patch from #2 and only hunk #3 failed. I assume from Zen's and Stephan's comments in #6 and #7 that #2 is the patch to work from.
Comment #10
coltraneOh, and the port should happen against DRUPAL-5--2? Or will recent changes make it over to the HEAD branch? Thanks.
Comment #11
Zen commentedYes, please - against 5--2-dev. But more importantly, the patch should be bereft of any new features or bug fixes which should be handled via separate issues.
Cheers!
Comment #12
coltranePatch from hswong3i in #2 rerolled. Applies against DRUPAL-5--2. Module installs and configuration works. I haven't tested anything else yet though.
Comment #13
Pedro Lozano commentedI applied this last patch and found 2 issues:
1. Autocomplete fields (title, url) in node edit form don't work. I've tried to fix this but didn't get it.
2. There is one theme_ function (relatedlinks) missing in hook_theme.
Comment #14
mbach commentedWould someone be so nice and integrate the patches in an initial D6 release?
Thanks for your support!!!
Comment #15
coltraneRerolled to take care of the missing theme function. Verified autocomplete field not working on node add/edit form. I looked at what might be wrong but haven't discovered it yet. I looked at what nodereference module for CCK 6 does to autocomplete and with just a quick visual compare they look quite a bit different though perhaps something can be learned from noderef's style.
Comment #16
coltraneAttachment didn't make it ... here we go again ...
Comment #17
Pedro Lozano commentedThe problem with autocomplete is that you have to call Drupal.attachBehaviors() function after adding content to the page from javascript code.
From drupal.js
Just add Drupal.attachBehaviors() after you add the textfield and it works.
Comment #18
mo6subscribe
Comment #19
coltrane@pl2, I'm not sure where you are saying to add Drupal.attachBehaviors(), can you roll a patch or post the code? thanks
Comment #20
Pedro Lozano commented@coltrane, this fixes the autocomplete issue. You may call attachBehaviors or just call the behaviour function that you need for your elements to work, as in this case.
Comment #21
psicomante commentedsubs
Comment #22
dave reidLove this module. Will help test a 6.x-dev branch. Subscribing.
Comment #23
nsilberman commentedsubscribe
Comment #24
dbooth commentedsubscribe
Comment #25
dbooth commentedI am running Drupal Core 6.3. I've downloaded relatedlinks-5.x-2.x-dev.tar.gz, untarred it and applied patches relatedlinks-6.x-222609-15.patch & relatedlinks-js-6.x.patch. When I go to Administer > Modules I see 'Related Links 5.x-2.x-dev Displays links related to content. This version is incompatible with the 6.3 version of Drupal core.' Have I missed something or can't this be used with 6.3?
Er, scrub that - it was TinyMCE causing the problem with Related Links all along, works fine if TinyMCE disabled.
Comment #26
JeremyL commentedAny update on when we might see an official alpha or beta port for 6?
Comment #27
dennys commentedsubscribe
Comment #28
Antinoo commented+1
Comment #29
chandrabhan commentedsub
Comment #30
theabacus commentedsubscribe
Comment #31
lumi_v commentedAny news of a new release of Relatedlinks for drupal6??
I am trying to put relatedlinks in drupal 6.4, I am very new on drupal and not very much experience.
I followed all instruction to patche the modul and still tell me is incompatible . Could somebody help me with a relatedlink modul ready patched .Thanks very much.
Lumi
Somebody help and the module workk now in Drupal 6 but only in admin.For all other users or anonymos does not show the links.Any thoughts????
Comment #32
Anonymous (not verified) commentedI'm waiting for this module upgrade , too
Comment #33
mrfelton commentedsubscribing.
Comment #34
mimhakkuh commentedSubscribe
Comment #35
clint.davis commentedSubscribe
Comment #36
burgs commentedsubscribing
Comment #37
spiffyd commentedsubs
Comment #38
aledt commentedHi folks, Just a quick update - I've rolled the patches together and deployed this on my 6.8 installation. So far, I've not been able to find any problems specific to RelatedLinks - the only problem I have found is a JS problem with Google Chrome (Add/Update functionality is broken).
I'll keep playing and raise any issues I find. Thanks for the hard work.
Comment #39
derekahmedzai commentedWhen are we likely to see a 6.x-dev release?
Comment #40
marvix commentedWhen are we likely to see a 6.x-dev release?
Comment #41
darumaki commentedsubscribe
Comment #42
spiffyd commentedThose that want 6.x, try the Similiar mod
Comment #43
mrfelton commented@spiffyd: the similar module doesn't really seem to do the same as this.
Anyway, I too have applied all the patches and it seems to be working ok for me so far.
Comment #44
scott859 commentedsubscribe
Comment #45
gustav commentedsubscribe
Comment #46
bigjim commentedhere's a patch, to 5.x.2.x-dev, and a full tar ball following the path laid out in #25. It works on a drupal 6.9 install.
I added the core=6.x to the info file and a bogus version just to make it easy to see on the modules page.
Comment #47
mrfelton commentedNoticed one bug. I don't know if this is specific tho the Drupal 6 version or not, but since there is no D6 -dev release, this is probably the most appropriate this...
If I add an invalid link (a link to a node that doesn't exist), then the link does not save. It all seems to be fine, and I get no warning that the link is invalid and therefore it will not be added, but when I do finally click save, the link is not actually saved.
Comment #48
moshe weitzman commentedThe schema of term_node has changed to include a vid column. Thats means we have multiple nid => term records which ruins the taxonomy calculation AFAICT. Nodes with many versions (i.e. have ben edited a few times) are considered more related which is clearly wrong. The latest patch does not address this. I only took a quick look so I could be wrong here.
Comment #49
moshe weitzman commentedI solved this in another module with COUNT(DISTINCT(tn.tid))
Comment #50
tjb74 commentedGet this error with v6 installed when applying taxonomies to uploads:
# user warning: Duplicate entry '255' for key 1 query: INSERT INTO relatedlinks_tracker (nid, keywords) VALUES (422, '') in ../modules/relatedlinks/relatedlinks.module on line 848.
# user warning: Duplicate entry '255' for key 1 query: INSERT INTO relatedlinks_tracker (nid, keywords) VALUES (423, '') in ../modules/relatedlinks/relatedlinks.module on line 848.
Comment #51
nnn commentedI see the same errors.
It was caused by the function _relatedlinks_update_discovered_links(), in which it always do _relatedlinks_add_links() and _relatedlinks_insert_tracker() , even if the link already has been added to the node.
The function _relatedlinks_update_discovered_links() was called from the relatedlinks_block(), and it is always called even though I have block caching on.
Could some one please provide a fix to this? I don't have the time these days. Thanks!
Comment #52
shah_waliuallah commentedsubscribe, any updates on this
Comment #53
mrfelton commentedupdateing title to make it easily identifiable in my issue queue.
Comment #54
bigjim commentedThe issues is the structure of the relatedlinks_tracker table the nid field is set to be a tinyint which has a maximum of 255, the same is true of the lid field in the relatedlinks table. So trying to insert a value of 422 into the nid field mysql converts the to 255 (as that is the maximum value) which it did previously for an earlier post and consequently you get a duplicate key error.
the solution is to change the type of the nid and lid field in relataedlinks_tracker and relatedlinks tables respectively to int in lieu of tinyint.
Comment #55
Z2222 commentedHow far away is the D6 version from completion?
I'd be willing to pay someone to finish putting this together and release even a working dev version for D6 early next week.
If there is a lot of work to do on it, maybe a few of us could chip in to have someone finish it.
Comment #56
Starminder commentedsubscribe
Comment #57
billybag commentedsubscribe
Comment #58
dr jason guo commentedI've quickly consolidated the above patches and made it work with D6, any wants to try it and let me know if there are any problems?
Comment #59
markalosey commentedI am trying this now and I have not seen any troubles yet....I will post back as soon as I see something funny.
Comment #60
federico commentedI've tested #58 and works fine on my localhost
Comment #61
qalkozai commentedI tested on localhost and the internal site does not work. I mean when entering an internal related page the database does a query and does not auto complete.
Comment #62
Z2222 commentedInvisigoth's version (comment #58) works for me.
THANK YOU! :)
(Why not make it live on the modules page so people can find it?)
Comment #63
dr jason guo commentedWill certainly do this shortly:-)
Comment #64
vlad79 commentedJust fixed the table myself after reaching 255 in the in the auto_increment of lid.
Anyways... it seems to me in the fix #58 above the "nid" is still of tinyint type, meaning after adding a node #255 it won't work.
Or may be I missed something.
Comment #65
authentictech commentedIs someone still intending to make the Drupal 6 version of this module from comment #58 a live release? Those who've tried it, is it still working without problems for you?
Thanks.
Comment #66
inders commentedI tried this mod and got this error:--
user warning: Duplicate entry '255' for key 1 query: INSERT INTO relatedlinks_tracker (nid, keywords) VALUES (341, '') in /home/singh123/public_html/www/indiauser.com/sites/all/modules/inder/relatedlinks/relatedlinks.module on line 848.
Comment #67
inders commentedI got it fixed by Using few code changes. However have not checked rest of code:-
Comment #68
mcurry commentedsubscribe
Comment #69
kansaj commentedOk I tried to repair the next error after applying the last patch, but somehow cannot get it working.
Comment #70
nicolash commentedsubscribe
Comment #71
bkat commentedHere's a quick little patch that fixes two annoyances:
1. ignore mailto links
2. Strip html from the link title
the tar file in #58 appears to be working for me on a site that is being upgraded from D5 to D6.
Comment #72
bkat commentedI ran the schema module on my D5 to D6 upgrade and it flag a few mismatches in relatedlinks. I think there are some columns that are erroneously declared as tinyint in relatedlinks.install. The documentation for tinyint on mysql says that a tiny int is 1 byte and its values range from -128 to 128. For all the following columns, I have values in them that are outside this range. Fortunately the D6 upgrade didn't do any alter tables.
relatedlinks.lid - removed size tiny
relatedlinks.nid - removed size tiny, added not null
relatedlinkstracker.nid - changed type to int, removed tiny
relatedlinkstracker.updated - removed size tiny
Comment #73
dr jason guo commentedI've packaged the fix for the problem "Duplicate entry '255' for key..." by altering the schema much like what #72 has done. We are using this patched version for our site running D6.14. Hope this helps.
Comment #74
mrfelton commentedWhy is development of the D6 branch of this module still taking place in this issue. This has been going on for the best part of a year now - it's crazy! Lets get a D6 branch in CVS and move the development to there.
@zen? I'll happily take co-maintainership of the module and sort it out for you if you like?
Comment #75
dr jason guo commented@mrfeiton - I totally agree and would appreciate if someone could take the responsibility to co-maintain this fantastic module. I've tried to do this a few months ago but didn't pursuit it when I got no response for a while. I'll also try to contact Zen for this and hope we can get the work back on track through a proper channel.
Comment #76
bkat commentedCan we fork it if zen continues to be non-responsive?
Comment #77
mrfelton commentedNo, we won't for it. If we continue to get no response I will ask the drupal.org webmasters to either transfer the project to me or set me up as a co-maintainer. It should take around take 2 weeks from the time I ask them.
Comment #78
mrfelton commentedI just put in a request to the webmasters: http://drupal.org/node/656026
@zen, if you read this anytime soon - please could you grant me CVS access so that we can get the code in ticket committed in one form or another.
Comment #79
juerg commentedThe module as posted above in #73 seems to work fine for Drupal 6.15. However I had to manually apply the following patch http://drupal.org/node/133099#comment-536396
Comment #80
espenmoe commentedIf it works fine, why did you have to apply the patch?
Comment #81
radiobuzzer commentedHi,
I have started running the code mentioned at #73 in my drupal 6 installation. The module got the settings from the previous installation. But I have a problem:
Anonymous users cannot see the block. I double checked whether it's hidden by the block access settings, but it is not, it has the same settings as all blocks.
Comment #82
drupalina commentedI tried #73 - Manual links don't work. After I add a few titles in node's edit and save, none of the added article links are showing up. Then when I go to that node's edit again, there is no mentioning of the added articles. It's as if the module does not remember which articles were added to the story manually.
(The Discovered links block seems to work okey, but, as others are reporting, it's not visible to the anonymous users)
Please-please get this module working for 6.x -- it's a very important module! Thanks for trying to port this to 6.x !
UPDATE: In my logs I found a php error that might be related to the Manual links mulfunctioning:
Comment #83
espirates commentedsubscribe
Comment #84
dman commentedI have tried out #73, and it's working for what I expected so far. Cheers!
This did a good job for me in D5, and I'm looking forward to getting a D6 branch in CVS we can start to use, now that the maintainer is back in town.
Comment #85
edg commentedThanks to all those who shared their work. Have been using patched version for over a year now on live site and don't appear to have had probs although would like to see an official release
Comment #86
drupalina commented@dman and @edg , Are you able to add manual links to nodes? Do they display in a block?
Also, do the bocks "Manual Links", "Discovered Links" and "Parsed Links" show up for anonymous users too?
If yes, please attach your versions of this module in 6x. Thanks a bunch!
Comment #87
dman commented#73 works with manual links for me!
Block visibility is normal, I'm pretty sure, though not really looked hard yet.
Detected links is a little odd as it uses the contextual text verbatim, when I'd prefer the title of the target (if local), but that's possibly old behaviour and what I want is a feature request.
Comment #88
radiobuzzer commentedI found what the problem was, for the module not being displayed to anonymous users. Or at least, partially.
When I enabled the module, I was using the Aggressive Cache (that's a setting at Performance section). The module didn't show up for any of the anonymous user.
I just managed to make it show up again, by disabling the cache for a second, cleaning all cached content, and then re-enabling it.
Unfortunately the block displays the same links, for all articles. If you do a cache clean, the block disappears again. Normal caching has the same problems, but the module doesn't disappear, it just stays the same.
I would suggest there is some template handling for blocks, that is being cached and the related links module doesn't handle properly. Don't forget that Drupal6 has introduced caching for blocks, which didn't exist in Drupal 5.
Btw is this v.6 CVS coming sooner or later? it gets annoying having to discuss everything in one thread.
Comment #89
mrfelton commented@zen: What happened to making a D6 branch for this? If development of the D6 version of this module is going to continue in this ticket it will simply never happen. I for one am not going to waste my time downloading tarballs, applying patches, and generating new tarballs. Please get this code into CVS where people can actually work with it relatively hassle free, and where everyone knows which version of is the most current etc.
I have offered my help several times...
I am bumping this severalty of this issue to Critical. Very few people are using D5 these days, and in the not too distant future official support for it will start to be dropped. Since the majority of people are using D6, this issue is critical to those people.
Once again, I offer my help in getting this into CVS and closing this issue.
Comment #90
radiobuzzer commentedAs far as I have noticed, mrfelton had submitted a ticket some time ago, in order to become a co-maintainer of the module. Unfortunately this ticket has been hidden, since zen re-appeared and I can't see why. I think that everybody would appreciate it if zen shared the responsibility of this project, as long as (s)he can't afford the workload. Being busy is fully understandable, most of us have been in this situation, but the project has to go forward.
Otherwise and since zen hasn't shown up for quite a while again, I would suggest going once again through the normal drupal process for marking the project as abandoned and asking the admins to grant access to mrfelton, or anybody who's shown interest by committing patches (eg bkat and invisigoth).
Last solution, forking
Comment #91
dman commentedditto to #90.
Offer of co-maintainership and a working port needing commital and another month or two of inaction.
It shouldn't be too hard to get this rolling again.
I'd love to work through and possibly revise bits of what we've got here in the D6, but contributions will be no good unless we get a D6 -dev branch out there.
Comment #92
captcha commented+1 to a D6 port.
Have been using Drupal 6 for a year now and using the patched module with code changes as issues come up.
Comment #93
radiobuzzer commentedFound how to solve block incompatibility with caching. The reason was block caching, and we need to specify that we ask for caching per page, and not for caching per role, as it is by default.
Insert this in line 161
so that the loop looks like
For users already having installed the moduled, you need to update the cache variable at the database, too. Go to your Database and run the query:
Sorry, I can't create a patch now, but if sb is in the mood, please do so.
Comment #94
inders commentedHi guys,
I got My issues fixed as:-
1) Was getting duplicate entry in related links table fixed that by
lid tinyint(3) ----------> to lid int(10)
nid tinyint(3)----------> to nid int(10)
2) Was getting error for stdclass at 1136 on relatedlinks.module in function _relatedlinks_collate_links()
--$set = @array_merge(array_intersect_assoc($set1, $set2) , array_diff_assoc($set1, $set2));
++$set = array_merge(array_intersect_assoc($set1, $set2) , array_diff_assoc($set1, $set2));
Just thought to ignore error as links are working fine and module is collecting all data properly.
Comment #95
inders commentedyou can check working module at: http://indiauser.com my testing & play site.
Comment #96
edwinwills commentedsubscribe
Comment #97
Zen commentedComment #98
Zen commentedI've made an alpha release. Please test and update this ticket as appropriate.
Thanks,
-K
Comment #99
inders commentedHi Zen,
Just got chance to check and test your new dev version and here is result of test:-
Code At 879:-
as per array_intersect_assoc() php function except array of strings but we have similar to:-
Here array key is nid but value is a node object. So need to fix this. I think can be replaced with some loop..
just added quik fix and tested that:-
This works fine. but have not checked if this do not effecting the results.
Thanks & regards
-Inder Singh
http://indersingh.com
Comment #100
btully commentedsubscribe
Comment #101
AntiNSA commentedCan you make a patch with your fix?
Comment #102
AntiNSA commentedIm getting this error user warning: Duplicate entry '255' for key 1 query: INSERT INTO relatedlinks_tracker (nid, keywords) VALUES (12296, '') in /home/cyberfan/htdocs/sites/all/modules/relatedlinks/relatedlinks.module on line 602.
Im using the newest dev release from march 10th... any ideas?
Comment #103
AntiNSA commentedsorry I am using the exact version 6.x-1.0-alpha1
Comment #104
inders commentedHi,
This can help:-
relatedlinks.module on line 602.
Change
Thanks & regards
-Inder Singh
http://indersingh.com
Comment #105
AntiNSA commentedThanks for your help! Starting on 601 and ending on 603 I have this code:
function _relatedlinks_insert_tracker($nid, $keywords) {
db_query("INSERT INTO {relatedlinks_tracker} (nid, keywords) VALUES (%d, '%s')", $nid, $keywords);
}
On 602
db_query("INSERT INTO {relatedlinks_tracker} (nid, keywords) VALUES (%d, '%s')", $nid, $keywords);
looks exactly like that you said
db_query("INSERT INTO {relatedlinks_tracker} (nid, keywords) VALUES (%d, '%s')", $nid, $keywords);
Im unsure what it is that you want me to change?
I really appreciate your help. I like this mod a lot... just these error codes I need to kill.
Comment #106
inders commentedHi,
You can place this line in if() condition. Check if $keywords are not blank or check if same entry exits in table.
You can replace your current line with:
Thanks & Regards
-Inder Singh
http://indersingh.com
Comment #107
AntiNSA commentedThanks again for your help! i have tried to alter the code and I keep getting errors... Im sorry I must be doing something wrong. Can someone help to make this into a patch for me? Im sorry I am so bad with php!
This by far is one of the most usefull modules and I really hope I can kill this error! Thanks!
Comment #108
Zen commented@inders: Please provide information on your setup. I am not running into this error. Please do so in a separate issue.
@AntiNSA: I see that a separate bug report has been created for your issue. I'll respond to it there.
-K