I am using the core blog module, and the subscriptions module. Subscriptions UI module is enabled, and adds a link to node $links called subscriptions-subscribe that adds a 'Subscribe' link to blog nodes. Everything works as expected until I rebuild this page as a panel.

As soon as I replace the standard blog node page with the node_view panel, and drop in a content pane for "Node being viewed" content (view mode = Full, links displayed), the 'Subscribe' link disapears from my node links - where all the others remain as intended.

I checked all the code inside the node_content plugin, but even though the node links are being returned properly, they are not being rendered on the page.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jenlampton’s picture

As a follow up here, the problem seems to be that $node->content['links']['node'] is not properly formed when the links are rendered via panels.

By adding #theme and #attributes to the $node->content['links']['node'] array, the links that subscriptions UI module added to the node get rendered correctly.

I'm not sure if the problem is that subscriptions UI us trying to add it's link into 'node' instead of creating it's own grouping of links, or if panels should always add the 'node' grouping so that other modules can add to it.

jenlampton’s picture

Title: Not all node $links are rendered via 'node_content' content type plugin. » Subscriptions UI module adds the 'subscribe' link on nodes incorrectly into 'node' group, which may be nonexistant
Project: Chaos Tool Suite (ctools) » Subscriptions
Version: 7.x-1.x-dev » 7.x-1.1
Component: Code » User interface
Status: Active » Needs review
FileSize
1.61 KB

On further consideration, I think this is definately the fault of subscriptions module. The link should be added into it's own group. I made this change to my copy of the module (patch attached) and everything started working again for me.

Status: Needs review » Needs work

The last submitted patch, subscriptions-fix_node_links-1837084-2.patch, failed testing.

salvis’s picture

Version: 7.x-1.1 » 7.x-1.x-dev
Status: Needs work » Needs review
salvis’s picture

Status: Needs review » Needs work

The last submitted patch, subscriptions-fix_node_links-1837084-2.patch, failed testing.

salvis’s picture

This is contrib, not core: patches need to be relative to the module's directory.

jelo’s picture

I just ran into this issue. I cannot get Subscriptions to work with Panels at all. I am surprised that this hasn't moved forward yet, given the large number of sites that use Panels. Anyway, I manually implemented the patch, but it did not make a difference...

jelo’s picture

Issue summary: View changes

add view mode and links

thomas1977’s picture

Issue summary: View changes

Using Panels here. Using Subscriptions seems to be a no go. BTW: I always use Panels for my projects.

I insert the Subscriptions interface into a panel region, but it just doesn't show up anywhere, regardless of logged in user role and whatever settings I make in the UI.

Best,
Thomas

wimberb’s picture

Has anyone come up with a solution for this? I just came across this problem when I redid my entire site to use Panels and all the subscription links disappeared.

sophiejones’s picture

Hello
I was looking for solution for another issue I have with subscription and came across this one. In regards to panel, if you want, you can switch to its block interface under its configuration page and add the block to your panel and it works fine.
My problem is that I want the fieldset to remain collapsed but it keeps open no matter what I do. but other than that, the block works perfectly in panels without a problem and you can find it under miscellaneous.
Hope that helps.

wimberb’s picture

I was able to get the Subscriptions link to show on nodes by creating a View set to display the "Rendered entity" at "Full content". Then adding the View to my Panels rather than the node itself.

salvis’s picture

It's too bad no one cares enough to fix the patch and test it...

(I don't have Panels.)

wimberb’s picture

@salvis, I would happily work on fixing the problem if I had the first clue about coding. The only codes I know are the building codes. I design houses.

wouser’s picture

@salvis I created a rendered view for Full Content but got lost after that.

The only reason I have Panels enabled is for Display Suite Layouts (Brick). I could disable it otherwise.

Few questions from a newb to panels.

1) How did you associate the Subscriptions block with the View or Panel.
2) What other Panels Module do you have enabled to get this to work.

Thanks in advance.

Side Note Solution: I was able to bypass this issue with panels/subscriptions with our previous theme by setting up a custom field (with blocks) with Display Suite. I added the block to Nodes and Users. Once I switched to my new theme (Professional) it stopped working again. Maybe this will help someone else.

salvis’s picture

I'm not using either of Panels or Display Suite, so I can't really help there -- sorry...

wouser’s picture

I meant to direct this question at : wimberb

wimberb’s picture

FileSize
6.07 KB
177.52 KB

@wouser, I simply created a view to display the node. Then in Panels I added that view to the Content. I am attaching the exported View if you want to use it.

DamienMcKenna’s picture

Status: Needs work » Needs review
FileSize
1.45 KB

The patch from #2 rerolled, and using the correct directory structure.

I haven't tested it yet ;)

salvis’s picture

The patch looks good — thank you, DamienMcKenna!

Those who have this issue, please test this patch...

+++ b/subscriptions_ui.module
@@ -44,12 +44,18 @@ function subscriptions_ui_node_view($node, $view_mode, $langcode) {
+            'html' => TRUE,

This is in the original code, but I think it's not needed.

+++ b/subscriptions_ui.module
@@ -44,12 +44,18 @@ function subscriptions_ui_node_view($node, $view_mode, $langcode) {
+        '#theme' => 'links',

Looking at a blog node, I'm seeing #theme values like 'links__node__node', 'links__node__blog', and 'links__node__comment'. Should we use 'links__node__subscriptions'?

wouser’s picture

Panels disabled, subscriptions show up.
As soon as I enable panels (with the above patch) it disappears still. Wiling to test any more possible solutions.

I am using Professional Theme, I use Panels for Display Suite, display of nodes.

salvis’s picture

From #2

The link should be added into it's own group. I made this change to my copy of the module (patch attached) and everything started working again for me.

That's exactly what the patch does.

Could it be that Panels somehow filters/limits the link groups that it displays?

salvis’s picture

rooby’s picture

Should we use 'links__node__subscriptions'

I would vote yes for this.
theme_links() is used in so many places and it is often helpful to be able to theme more specific lists.

salvis’s picture

Status: Needs review » Needs work

#19 looks good except for #24, and that it's not actually working (#21)...

DamienMcKenna’s picture

Status: Needs work » Needs review
FileSize
1.47 KB

Updated to use links__node__subscriptions.

Status: Needs review » Needs work

The last submitted patch, 26: subscriptions-n1837084-26.patch, failed testing.

DamienMcKenna’s picture

Status: Needs work » Needs review

The tests failed because there are no tests, see #2645590: Ensure that simpletest job doesn't "fail" testing if no tests are present for more details.

salvis’s picture

Yeah, that is a pain. I've added a dummy test to get over this.

Updated to use links__node__subscriptions.

Does that mean we need to provide a theme function?

This won't help with #21, will it? What could be the problem there?

rooby’s picture

Does that mean we need to provide a theme function?

No it still uses the default links theme function, it just means you can override it with more granularity if you desire, instead of having to override all links and then try to work out which links you are styling by the content.

The double underscore is a delimiter, so it will look for these overrides in this order:

  1. links__node__subscriptions
  2. links__node
  3. links
salvis’s picture

@wouser (#21): It has been a long time, but would you care to try this?

Thanks for the explanation, rooby!

robladdish’s picture

Bummer, we've run into this too in the latest drupal 7.x branch, brand new site. Subscriptions shows up on content types with no layout. Under manage display, there is no entry for Subscriptions which is it's own problem. Somehow it's magically added to the page.

As soon as we enable a layout (changed from none) to either Display Suite or Panels, then a single entry called "Subscriptions" shows up, but it doesn't seem to do anything and we lose all functionality. I tried many different layouts and still have the same problem.

It looks like the subscriptions ui code auto-adds a field group called subscriptions that we can't see, and has it closed by default. Inside it are all the possible subscription settings. Ideally, this field group should show up on the manage display listing so we can place it where we want and used advanced layouts with Display Suite, Panels, or other. It would also be useful to have more control over the contents of this field group. For simplicity, we might want to just enable the checkbox "subscribe to this content node" only and skip the rest of the complexity. Yeah, open source, if I want it I should code it, but just getting started in Drupal, so I'm not there, just trying to be clear and paint a vision of what it could look like to see if this is what others would expect too.

I tried patch #26, but it didn't help. Darn! If anyone else has other suggestions, it would be great. Every time we try this, it totally screws up our existing 20-30 fields, so it's a few hours work to test and then get it all back to working again ...

Any other ideas? Thanks for any help!

salvis’s picture

Status: Needs review » Needs work

So, apparently, this is not working right yet...

NWOM’s picture

#26 sadly still doesn't fix the issue. You can reproduce the problem in the following way (using Panels):

  • Applied the patch.
  • Fieldset in Subscriptions interface block (below the comments) initially active"
  • Ran cron / Cleared Cache
  • Added the Page Content "Subscribe" field to the overridden panels node view page.
  • Edit the Subscriptions settings to now instead be "Fieldset above node links (and comments)"
  • Ran cron / Cleared Cache
  • Now the Subscribe pane will be corrupt and the Subscribe link can't be re-added
Harsikesa’s picture

any news on this?

I also having the same problem, can not add subscription link via panel.
Please.... help....

---Update---

Problem solved, i just need to change the visibility settings from: /admin/config/system/subscriptions
[Node form position]
from
Fieldset above node links (and comments)
changed to:
Fieldset in Subscriptions interface block (below the comments)