Closed (fixed)
Project:
Command Buttons
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
23 May 2014 at 19:45 UTC
Updated:
12 Jun 2014 at 21:20 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
scottalan commentedComment #2
scottalan commentedHaven't made a PR yet but this is basically what it will be. May need a little clean up. Will look it over better and make a PR later.
https://github.com/scottalan/oa_core/commit/de4649d38a3e46fbf287bea0fb53...
Comment #3
scottalan commentedCleaned up the code and made a PR. https://github.com/phase2/oa_core/pull/56/files
Comment #4
scottalan commentedChanged the way the title is built so that it is built with the Section Type and the title of the Section.
The new title will be something like:
Create Discussion Post in SECTION_TITLEComment #5
mpotter commentedLooking better. A couple of comments:
1) Sorry for the lack of documentation, but there is a helper function "oa_core_get_titles()" in the oa_core/includes/oa_core.util.inc file that you can use to grab the title. Since this will get cached in the future, it is better to use it. Otherwise you could also use node_load in this case since the parent and section nodes have already been loaded and cached to construct the OA toolbar.
2) Don't forget the t() around 'in'
Comment #6
scottalan commentedAh, I was wondering if there was an api for titles. Should have searched a little harder. I will make the updates when I'm done with another fix I'm making and will post a new patch. Thanks for the feedback.
Comment #7
mpotter commentedOh, and
3) Only add "in section name" if there is more than one choice.
Comment #8
mpotter commentedThe pull request in oa_core has been merged! Thanks for the help on this!
Comment #9
scottalan commentedTwo options:
Option 9.1: Handles both the space command buttons and the section command buttons. This may be overkill.
Option 9.2: Less code and, I think, makes more sense when you are in a space context viewing the command buttons.
I also looked at oa_core_get_titles(). Is that a little heavy since I just need the title and have access to one `id` at a time in the foreach? Let me know.
Thanks
Comment #11
mpotter commentedYour first patch was more what I was looking for. I also changed the db_query into a proper D7 db_select. Also removed a line that was filtering a query to only node_add command buttons, preventing custom command buttons from being used.
Committed to 41fdee2.
Needed to make some changes to oa_core also, but doing that as part of the 2.19 release, so stay tuned.
Comment #12
scottalan commentedAwesome! Thanks Mike.