We have placed the Sharethis block on each node page. This is NOT the widget. The urls generated are to node/[nid] and not the full path.

Based on https://www.drupal.org/node/2699705 and https://www.drupal.org/node/2755679, this doesn't seem to be the intent.

For now, a quick fix might be to use \Drupal::request()->getUri();. This doesn't use dependency injection, but it works.

Please let me know if this isn't the intent of the module. If it's not a universal intent, maybe we add a variable to the configuration object sharethis.settings.

Comments

pandaeskimo created an issue. See original summary.

damontgomery’s picture

Here is the patch. Created from 8.x-2.0-beta3.

Status: Needs review » Needs work

The last submitted patch, 2: sharethis--absolute-paths-for-block--2880471--2--d8.patch, failed testing.

basil_snowman’s picture

Status: Needs work » Needs review
StatusFileSize
new1.08 KB

changed patch to 8.x-2.x version of the module.

andypost’s picture

Status: Needs review » Needs work
+++ b/src/SharethisManager.php
@@ -112,10 +112,9 @@ class SharethisManager implements SharethisManagerInterface {
+      $m_path = \Drupal::request()->getUri();
       $mtitle = $this->titleResolver->getTitle($this->requestStack->getCurrentRequest(), $this->routeMatch->getRouteObject());

You should use request stack & master request

andypost’s picture

Status: Needs work » Needs review
StatusFileSize
new852 bytes
new1.23 KB

Looks in service better to use current request

andypost’s picture

piggito’s picture

Regarding the collision with issue Title can be a plain text , I'm adding a combined patch which includes:

greg boggs’s picture

Same issue as: https://www.drupal.org/project/sharethis/issues/2978770 which also fixes the issue.

greg boggs’s picture

StatusFileSize
new1.41 KB

Adding a reroll of this one just incase it's helpful.

greg boggs’s picture

Status: Needs review » Reviewed & tested by the community
naveenvalecha’s picture

Status: Reviewed & tested by the community » Needs review
Related issues: +#2978770: Node URL convert user friendly URL

@Greg Boss
Please don't make your patches RTBC. See the process https://www.drupal.org/issue-queue/status#rtbc

greg boggs’s picture

For clarity and proper credit, this patch is Piggito's. I just rerolled it when I reviewed it to remove the bit we took care of in the other issue.

From the RTBC documentation you linked, since it was someone else's work, and I tested it:

"At the end of the day, setting an issue to this status is a judgment call: if you have thoroughly tested and reviewed the patch and believe it is ready, you may change the status; if you are unsure, the status should not be changed. Simply add the findings of your review to the issue."

naveenvalecha’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

#13 Fair enough
The patch needs reroll before it gets committed.

mrinalini9’s picture

Assigned: Unassigned » mrinalini9
Status: Needs work » Needs review
StatusFileSize
new1.41 KB

Rerolled patch #10, please review.

mrinalini9’s picture

Assigned: mrinalini9 » Unassigned
naveenvalecha’s picture

Status: Needs review » Fixed
Issue tags: -Needs reroll

Thanks!
Committed and pushed to 8.x.2.x

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.