Closed (won't fix)
Project:
Disqus
Version:
6.x-1.x-dev
Component:
Miscellaneous
Priority:
Major
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
5 Dec 2008 at 20:54 UTC
Updated:
19 Jun 2014 at 16:51 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
robloachDefinitely is a problem. I'll have a hack at it this weekend.
Comment #2
robloachI just made a huge commit with an upgrade path to change the URLs on Disqus from /path/alias to /node/%nid . Since you're the only one I know of using Disqus with the path aliases, mind testing this? On my local box it worked, but I'd love more tests! :-)
Pretty much just overwrite all the files and run update.php ;-) . It'll go through all your nodes and update the path to use node/%.
Comment #3
timmillwoodSure, I am in the process of moving server and tidying / updating all the modules. Will try to feedback ASAP.
Comment #4
radj commentedsubscribe.
Comment #5
yha commented#343363: Use the direct node path rather then the node's alias.
it makes duplicate entry at my sites.
how do I use the node's alias than the direct node path to every comments link/disqus comments?
Comment #6
robloachThe problem with using the path alias is that if the path alias changes, then you'll loose the discussion thread. Using the node path (node/#) ensures that the discussion thread stays the same even if the path changes.
Comment #7
el7cosmosi think link to disqus thread on node links should be using the node alias.
node/[nid]#disqus_thread » [node_alias]#disqus_thread
Comment #8
robloachOne important thing to note is that we have to keep the Disqus Identifier the same. Not sure if this will work, but it's worth a try.
Comment #9
Jamie Holly commentedOne way around this might be to use the Disqus API. There is a "edit thread" API call where you can change the slug and URL of a thread. If the URL alias changes then make a call to the API to change it on Disqus also.
Comment #10
Jamie Holly commentedOK I played with this idea some more. Here's how it could be handled.
First problem is that the current module creates threads on demand, ie: when the node is viewed the through the javascript call. The work around would be to call thread_by_identifier on node insert. We keep the identifier the same as now (node/{nid}). If that thread isn't found with the thread_by_identifier API call then it is created, but it will return a thread object, including the needed thread_id for below.
After that we do an update_thread and change the URL,Title and maybe even add a box in the node form to change the slug if people want to.
The only problem I see is with modules like pathauto. The work around there is to set the weight of the disqus module higher than the weight of the pathauto module (maybe set it to 99).
Also a it would be best to store the forum_id and forum_api_key in a variable. Best route would be to grab those from Disqus when the Disqus settings page is updated.
Now the identifier for Disqus will always be the never changing node/{nid}, but the URL on the Disqus forum page would be the alias URL (good for SEO), plus the title will change on the thread - great for typos.
The other thing is that the changes in update_6000 will basically have to be reverted, since that changed everything to the src URL instead of the alias.
Comment #11
robloachI like the idea of calling the Disqus API when a node is saved/updated, but using the alias as the unique Disqus identifier is an extreme bad idea. The identifier is meant to be unique to the site, and that's what the Drupal path is. It's better to keep things as simple as possible.
What we might want to look into is the disqus_url variable. If you look at the bottom of the page, you see disqus_url (a link to the article), disqus_title (the title of the article), and disqus_identifier (must be unique). I think if we change disqus_url to use the alias, we might be good as that, in theory, is what Disqus uses to send the user back to the site. It would need some testing though....
Comment #12
Jamie Holly commentedYou can keep the internal Drupal URL as the alias, just change the URL for the Disqus thread through the api (url != identifier). Here's an example of that:
http://intoxination.net/jamie/my-big-prediction-2009
The Disqus identifier on that page is node/12623, however if you go to the Disqus page:
http://disqus.com/forums/intoxination/my_big_prediction_2009/
The URL on the page is the alias.
Comment #13
robloachThis needs A LOT of testing, including the upgrade path. Would be great to test on a few live sites too. It uses the disqus_url as the path alias, but keeps the identifier the same.
Comment #14
bradweikel commented#867798: Social Media Reactions don't appear when path aliases are used is a duplicate of this issue, but highlights that it's a bit more important because it completely breaks social media reactions for sites using pathauto + path_redirect. I'll do some testing Monday (please hold me to it).
Comment #15
bradweikel commentedFunctionally, this patch works. The upgrade is fine -- existing comments and reactions are still intact (not surprising, since they still use the same identifier).
The only thing that needs changing is the surrounding comments, which should be updated to reflect the changed behavior.
Comment #16
bradweikel commentedScratch that. This needs some more work, or at least more discussion, because of a (inter)dependency re: #750678: Comment count link goes to node/# rather than alias.
The comment link on teaser pages doesn't use the identifier, it only uses the URL, so these two issues should be fixed at the same time and in a way that doesn't reset the comment & reaction counters on those teaser pages... although I'm not sure if that's possible.
However, it is pretty clear to me that, aside from the upgrade path, this is the correct direction to be going. On new nodes, this is working perfectly (when combined with the patch from #750678: Comment count link goes to node/# rather than alias) -- it's just the upgrade stuff.
[EDIT]
Turns out that Disqus.com has a new 301 redirect crawler that fixes the upgrade issue pretty effectively by just crawling your URLs and updating the threads to use the latest URL, which means the counters on the teaser page don't get reset.
I'd suggest combining the patch above with the one from #750678: Comment count link goes to node/# rather than alias and then documenting that site administrators using path aliases need to enable the globalredirect module (important for SEO anyway) and then run the crawler on Disqus.com
Comment #17
mchelensubscribing
Comment #18
benklocek commented@bradweikel In the last line of your comment, you suggest using the globalredirect module. Is this for the counters on the teasers? So the crawler gets the updated url?
That patch (#750678: Comment count link goes to node/# rather than alias) is not working for me. Are you getting the alias when you click on the comment count after applying it?
Comment #19
bradweikel commented@benklocek - Correct. The GlobalRedirect module creates a 301 redirect from your node/xxx URL's to your aliased URLs. So when the Disqus.com crawler checks your URLs, it knows to move the existing threads to the aliased URL, preserving your comment counts when the patch is applied. Just run the crawler after enabling global redirect and it should work, although I remember a bit of a delay between running the crawler and the threads actually moving over.
Comment #20
benklocek commentedThanks @bradweikel. I'll give that a try once I get the #750678 patch working for me.
When the node alias changes (say the path auto generated alias generated from a changed title), should that change be reflected in Disqus as the displayed url? In this thread http://drupal.org/node/867798, the discussion recommend using the alias as the Disqus url, and the node/# as the Disqus ID.
The issue I have occurs when Disqus loads on the unpublished post preview, thereby getting the url of the post which may change before publishing. I then need to use Disqus' migration tool to change the url to the final published url.
Is there a simple way to prevent Disqus loading before publishing?
UPDATE: I added path_redirect, which gives me the "Create new path and redirect from old" in the Pathauto settings, so that should take care of the URL changing (although I'm a little concerned about Reactions being found properly) time will tell.
I'm Also still exploring not displaying the Disqus comments unless the post is published (with some PHP on the block display form):
Additional Note: That patch #750678 is not working for me. Are you getting the alias when you click on the comment count after applying it?
Comment #21
cameron tod commentedEdit: this comment is totally redundant. Don't browse issues on Friday afternoons, kids
Disqus provides a facility to set a custom identifier of your own specification. I'm not sure if the discussion here considers this or not (there seems to be a lot of overloading of terms). From http://help.disqus.com/entries/103890-how-disqus-uniquely-identifies-and... :
This seems like an easy fit for the node id, and I'm going to try implementing it now to see if it works as described.
Comment #22
teastburn85 commentedJust wanted to share another approach. For anyone who has a multi-stage set up, uses the Deploy module or for some reason can't depend on nids, neither /path/alias nor /node/nid work. Using a phptemplate_disqus_comments function, I overwrote the theme_disqus_comments function and made my own version of disqus_footer that uses the UUID module so that comments can be associated with a thread totally independent of its title and/or nid. If anyone wants more details on this, I'd be happy to share.
Thanks
Comment #23
rootworkHas this been addressed? As far as I can tell, it continues to be the problem behind #867798: Social Media Reactions don't appear when path aliases are used
So Disqus comments work great, but Disqus reactions are nonexistent, and result in the error "Sorry, there was an error adding this thread to the reactions queue" when you try to manually scan for them.
To me this is a major issue since reactions are 50% of why people use Disqus in the first place. Happy to be convinced otherwise, but this seems like a big deal. If it's been addressed and the module is using aliases now, we need to open a new issue and troubleshoot why reactions are nonfunctional.
(Should go without saying: Love the module! Thanks for your hard work! Only want to make it even better!)
Comment #24
XiaN Vizjereij commentedSubscribing
Comment #25
rootworkUpdated the title to reflect the reason many people will encounter this issue.
I corresponded with Disqus support on this, and they suggested setting the disqus_url variable to the "final" path. (I'm not sure if that's the best solution, or if it's the disqus_identifier suggested in #21.)
It seems like the module could check if a path alias exists, and if so, set disqus_url as described in the help document. Of course I'm only speaking theoretically here, as I don't think I have the PHP/Drupal hacking chops to figure out how to do this in the module...but I'm happy to test patches!
Until then, it seems that Disqus Reactions (mentions in social media) will be broken using this module if you also have pathauto enabled.
I've tried this with and without both path_redirect and globalredirect modules -- but the automatic redirect doesn't seem to be enough for Disqus to realize things have moved, since the post to Disqus initially sends the core node/# address.
Comment #26
espenmoe commentedSubscribing
Comment #27
robloachCould you check the latest 6.x-1.x? The latest commit changes to Drupal.settings instead of straight inline code. It also makes use of the identifier for the comment number links too.
Comment #28
rootworkJust installed the latest -- will report back. Thanks!
Comment #29
HowardLake commentedThanks Rob and Rootwork for your work on this. Fabulous module, so thank you, but yes, getting the pathauto and reactions combination fixed would be much appreciated.
Comment #30
Cloud commentedSubscribing...
I have installed the latest version of this module but the reactions doesn't work, e.g.:
http://newtechpost.com/2011/04/08/sisaf-delivering-drugs-accurately-and-...
Thanks
John
Comment #31
robloachThe thing about using the URL Alias instead of the actual ID is that if your alias changes, Disqus does not get that change, and the links from Disqus break. I'd recommend using http://drupal.org/project/globalredirect to push people from those links over to the URL aliases.
Comment #32
rootworkJust to clarify for the record: I have Global Redirect installed on all my sites, and it doesn't affect/fix this issue for Disqus. But I respect your decision to decide not to fix it.
Comment #33
djschoone commented@cam8001 did you get any further with this? (= using the disqus_identifier)
Comment #34
resmini commentedAny news on foreseeable solutions?
I do have the most recent pathauto / global redirect installed on a 6.x install, had Disqus crawl my website again, but no reactions are coming up (after 6hrs).
I understand the problem with aliases being really aliases, but if reactions do not show up at all from the beginning, it seems we are trading a system which can possibly break up in the future with a system which is broken from the start.
Glad to give any patch a try, in case.
Comment #35
rootwork@resmini The module maintainer has said they won't fix it. If you want to explore trying out a fix, they might accept a patch. But it's unlikely anything will happen otherwise.
Also, since this issue is closed, it's unlikely it will get much attention posting here anyway.
Sorry to be the bearer of bad news. I wish it worked better with Drupal too.
Comment #36
WeRockYourWeb.com commentedI understand the logic behind the URL node vs alias now. However, I'm noticing something strange: the export from Drupal > Disqus creates node ID's. However, new Disqus comments made on our Drupal site show up as aliases in Disqus.com. Any way to update the export feature so it uses aliases since new links are being aliased by Disqus.com anyways?
Btw, are reactions still broken or do those work?
Comment #37
rootworkIt's been a long time since I looked at this, but I think reactions are working now -- I'm not sure if it was an update in Disqus or the Drupal module.
In terms of your other questions, you should open a new issue -- this one is closed, so it won't get much attention if you post questions on this one, and given the amount of time that has elapsed it may not be related to the OP here anyway.
Comment #38
WeRockYourWeb.com commentedThanks rootwork. I posted the Q here: http://drupal.org/node/1349010
I really think it's key that the export file be updated to use aliases under the
<link>tags. I found the spot where the link ID is output in disqus_migrate.export.inc, and figure all that needs to be done is have the DB queried for the alias as well, and have that written in that place. I'd be willing to sponsor someone getting this work done.