according to documentation I should be able to use views to display rules_links but the links I create are not available in the views field drop down.
according to documentation I should be able to use views to display rules_links but the links I create are not available in the views field drop down.
Comments
Comment #1
BenK commentedI'm experiencing a similar problem. First, to make the links available in the Views config screen, you need to upgrade to the latest Views-7.x-3.x-dev release. Once I did that I could select my Rules Link as a field.
However, even after doing that, the actual link was not displaying in my View.
Ideas, anyone?
Thanks,
Ben
Comment #2
sepgil commentedHave you selected the right bundles? Are your visibility conditions correct?
Comment #3
itangalo commentedI get similar results, and after digging around in the code I think I know why.
In rules_link.views.inc, line 43, there is this condition for rendering the link:
if (in_array($entity->type, $rules_link->settings['bundles']))This works well for nodes, but bad for eg. comments – since comments don't have the type property. One would like to have a generic
$entity->bundleproperty, but I'm pretty sure Drupal doesn't provide that by default.The solution for this is, probably, to load Entity API functionality and use that to check $entity->bundle. (Another approach would be to skip the separate bundle setting and use the visibility conditions instead – but that would decrease usability.)
Note: The field is listed when editing my views, but the actual output is not rendered.
Comment #4
sepgil commentedI think I've fixed by fixing other issues, can anyone try to reproduce this issue with the newest dev version?
Comment #5
oscarmatox commentedNot only did I reproduce with the dev version of Oct 21, but the link on the entity's page no longer shows.
Here's what I did, if you want to try and reproduce:
I then created a new Article. No link when displayed. On another Drupal sandbox with rules_link-7.x-1.x-beta2, I have the link.
Hope this helps, because this module clearly fills a need!
Bruno.
Comment #6
pradbone commentedUpgrading to the latest version of views Dec resolved this issue for me.
Comment #7
sepgil commentedThe might have caused the problems...
So please update to the newest views dev version and the problems should be fixed.
Comment #9
Yuri commentedIm using the latest 7.x-2.x-dev (8 dec 2016) and encountered the same issue.
However, I found out that this was caused by one of the rules links rules to have an incorrect configuration.
This causes all other rules links, also the good ones, not to show up in views.
Comment #10
Yuri commentedComment #11
nwom commentedThe Needs Review status is for reviewing attached patches. I assume that you wanted to set the status to Active in this case.