Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Here's a simple content type plugin that provide user links for a comment. It's almost a straight copy of node_links.inc.
I know that links for users is not a standard concept, but a few modules provide them for all entities in a generic fashion. One example is Flag module.
So, IMO this would be a useful addition.
Comment | File | Size | Author |
---|---|---|---|
#3 | ctools-user-links-content-type-3.patch | 2.53 KB | Michelle |
ctools-user-links-content-type-0.patch | 2.43 KB | dixon_ |
Comments
Comment #1
dixon_Cross-linking to #2058501: Provide comment links content type plugin as well.
Comment #3
MichelleThis gives me the following error:
"Notice: Undefined index: links in ctools_user_links_content_type_render() (line 42 of /var/www/html/drupal-contrib/sites/all/modules/ctools/plugins/content_types/user_context/user_links.inc)."
The line is:
$block->content = $account->content['links'];
You say, "I know that links for users is not a standard concept". Does that mean these links are not part of core? If so, then I guess the fix would be to check if that array element is there before trying to use it. I took a stab at a patch that gets rid of the error and simply returns nothing if there are no links.
Comment #5
japerryMarking needs work based on comment #3.
Comment #6
japerryThanks dmckenna for taking notice that I was talking about patch 0 and not patch 3. After trying that one, feature looks good.
Fixed!