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've created a patch which makes one type-o fix and adds a feature to crm_core_activity_ui_add_activity()
which generates the general "Add an activity" page:
- The title was set to "Add a activity" ('a' instead of 'an') in contrast to the 'title' set in hook_menu(). The fact that MENU_LOCAL_ACTION's don't get their 'title' used is actually a core bug. To work around it, my patch looks up the title used by hook_menu(), so that you don't have to repeat it twice (adhering to the DRY principle - and allowing other modules to use
hook_menu_alter()
to change the title). - When there is only one activity type, it will immediately forward the user to the page to add that type. This is exactly the same as the 'node' module does in it's
node_add_page()
callback, when there is only one node type.
I'll attach the patch in a moment!
Comment | File | Size | Author |
---|---|---|---|
#2 | crm_core-activity-add-2005306-2.patch | 1.24 KB | dsnopek |
#1 | crm_core-activity-add-2005306.patch | 1.14 KB | dsnopek |
Comments
Comment #1
dsnopekPatch attached! Please let me know what you think.
Comment #2
dsnopekHeh, after looking at the generated patch I noticed another type-o. New patch attached!
Comment #3
RoSk0Fix from #2 committed in development branch.