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.
I have created my own entites in a project. When i wanted to integrate with privatemsg I realized that it was no possible. How about offer the possibility of showing the "Send author a message" in all bundles, including custom entities created by the developer, not only in content types?
I could develop a path if you think it is interesting.
Thank you.
Comment | File | Size | Author |
---|---|---|---|
#12 | allbundles-1660876-12.patch | 5.22 KB | Enxebre |
#10 | allbundles-1660876-9.patch | 4.86 KB | Enxebre |
#8 | allbundles-1660876-8.patch | 4.83 KB | Enxebre |
#5 | allbundles-1660876-5.patch | 4.08 KB | Enxebre |
#1 | allbundles-1660876-1.patch | 6.59 KB | Enxebre |
Comments
Comment #1
Enxebre CreditAttribution: Enxebre commentedI have made a path for offer the possibility of choose any bundle existing in the site ( not only content types or comments). privatemsg can be selected as an own extrafield in display form for any view mode.
I hope it could be useful
Thank you.
Comment #2
Enxebre CreditAttribution: Enxebre commentedComment #3
BerdirPlease provide a unified diff, it looks like you have a git checkout, so all you need to do is git diff within the privatemsg directory.
The testbot is not going to like this patch.
Comment #4
BerdirNote that new features are only added to the 7.x-2.x branch.
Comment #5
Enxebre CreditAttribution: Enxebre commentedOk.
I have made a new patch in the way you told me over the 7.x-2.x branch.
Thank you very much.
Comment #7
BerdirLooks interesting but there are quite some potential issues, some feedback:
- We should change the variable name and add a proper upgrade path from the old settings.
- Migration needs to include the show_on_comments settings, If enabled, all node types that are enabled should have the corresponding comment bundle enabled as well and then the show on comments setting can be removed as well. Users can then fine-tune those settings they way they want to.
- There is no requirement that bundle names are unique, so it is possible that you have e.g. a node and term bundle that's named the same way, probably needs a combined key of entity_type and bundle.
- There is no standard way of getting the uid of an entity. We might need to find a way to filter out those that we don't know it, not sure how yet. Maybe rely on entity propeties from the entity.module.
- Instead of $entity->title, you need to use the entity_label() function.
- Moving the links out of content['links'] is problematic, why is that necessary?
Comment #8
Enxebre CreditAttribution: Enxebre commentedhi Berdir!
I dont understand the second feeback. Do you want to say when somebody click on "show_on_comments" the comments bundles settings should be enabled too with a js or something like this. Tell me is that is correct please.
Names are composed now for entity and bundle name.
As you say there is no standar way of getting the uid of an entity, it could have no uid if the developer wants, so this is the most solid approach I have thinked. (you can see in the new patch)
entity_label() is used now
Links is ignored by display suite in nodes. Moving to an own container and exposing it in extrafields you have display suite integration for every bundle, for every views mode exisiting in the site, not only full or teaser, so you can put your privatemsg link where do you want through manage display ui.
You can see all this changes in this new path.
Thank you.
Comment #10
Enxebre CreditAttribution: Enxebre commentedattach the path with a correction
waiting for your reply.
Thank you.
Comment #11
BerdirNo, I'm saying that we don't need the comment setting anymore because you can now directly enable for which comment bundles you want to have it displayed. The setting isn't check anymore anyway. However, we want to migrate it by selecting the comment bundles as well for the
The argument for entity_label() is the entity type, not the bundle.
The patch now adds a dependency on entity.module, we didn't have that before and that's probably why the tests explode.
Same for that links thing. Yes, it is nice to have DS integration,but your change would almos require DS, no? Because without it, the links aren't displayed within the links as they were before, right?
Comment #12
Enxebre CreditAttribution: Enxebre commentedI have changed the entity_label and I have added entity dependency.
DS dependencie are not really required, because we are adding the field with hook_field_extra_fields no with hook_ds_fields_info. Making it in this way we have the privatemsg option for every bundle we have selected in settings. Including when we are not using a custom ds layout or ds is disabled we have the possibility to choose privatemsg in manage display interface and display it.
Thank you.
Comment #14
Enxebre CreditAttribution: Enxebre commentedNote that you could remove as you say "Display links on comments of selected content types." and "Display link on teasers of the selected content types." could be removed too.
Comment #15
Enxebre CreditAttribution: Enxebre commentedComment #16
ptmkenny CreditAttribution: ptmkenny commented#12: allbundles-1660876-12.patch queued for re-testing.
Comment #18
ivnish CreditAttribution: ivnish commentedComment #19
andypost