Closed (fixed)
Project:
Chaos Tool Suite (ctools)
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
13 Aug 2015 at 18:52 UTC
Updated:
5 Feb 2017 at 07:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
eugene.ilyin commentedI've prepared a patch for this functionality
Thank you!
Comment #3
eugene.ilyin commentedCan somebody review it please?
Comment #4
rivimeyThe patch looks ok, and it is good that you have added the .api doc for it.
The text of the comment could be improved. It would be good, also, to include some details about what can be found in the handler object at this point in the request's life, and note if there are things that must not be changed (likely because decisions have already been taken based on the current value).
On a wider point, I am not sure it is good to include a new hook in ctools at this point in the release cycle. I can see that for some users it will be very useful, and of course we have several years of D7 life left, but still... Any thoughts from others?
Comment #5
eugene.ilyin commentedThank you. I updated patch
I'm not sure about it. Handler is a stdclass object with a lot of properties. We shouldn't change did, name or task properties, but I don't think that we need an explanation about it.
I think that this my proposition is better than current state of the function:
function ctools_context_handler_pre_render($handler, $contexts, $args) { }it looks unnecessary
Comment #6
eugene.ilyin commentedComment #7
rivimeyThanks for the revision, it looks good.
I also agree that the existing pre_render function appears to be pointless, and that what you propose is better than that. My concern is mostly that we're adding new code paths to a module that is already a maze of poorly understood code, and irrespective of the merits of a specific change, adding new code paths to that seems the wrong way to go.
I have had a look into why
ctools_context_handler_pre_renderis empty. The function, previously added in 2010 by Sam Boyer (history unknown) was then deleted in Issue 1191566 by a change that included @MerlinofChaos, @Dawehner and @DaveReid. The reason the function was not deleted entirely was: "Quick review: Can't remove ctools_context_handler_pre_render() -- it can be empty, though. But it gets called externally, removing it would break API." Given this, it is possible there is still code that expects this function to do something other than call new handler functions. it would be stupid code, but still...In summary I don't think this change should be accepted as-is without several other people chipping in confirming it would be both safe and useful.
Comment #8
rivimeyProposing RTBC for the next 'features' release - 1.13 - with the proviso that @japerry agrees this is a good thing to do.
Comment #9
rivimeyComment #10
japerryAye I agree. Committed.