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.
A couple of small things:
1) The links point to HEAD, and should probably point to installed version.
2) Links for non-core modules are broken
So the patch...
1) Adds a constant at the top of the module for the current Drupal version and use it in the core module links instead of HEAD
2) For each function in the list, if it's not part of core, it doesn't create a link but just displays the name of the function along with the module and file names. Only works in php5 (uses reflection) but does not break in php4
What do you think about linking to CVS for the module for the non-core functions ?
Comment | File | Size | Author |
---|---|---|---|
#5 | devel_296268_function_reference_linkfix.patch | 1.13 KB | pahariwalla |
#2 | function_reference_linkfix.patch | 1.22 KB | pahariwalla |
function_reference_linkfix.patch | 1.43 KB | pahariwalla | |
Comments
Comment #1
moshe weitzman CreditAttribution: moshe weitzman commentedThe D6 version of devel already links to the right version of Drupal. Feel free to backport that and submit a patch. If you are going to do limit this to just core, i think you are better off excluding functions that are in the sites/ tree
Comment #2
pahariwalla CreditAttribution: pahariwalla commentedLovely... attached is the patch without links to non-core modules.
Comment #3
pahariwalla CreditAttribution: pahariwalla commentedI neglected to change the status back to "review".
Comment #4
moshe weitzman CreditAttribution: moshe weitzman commentedDoes that reflection Function cost anything in terms of performance? Why does the patch mention /modules? Seems like we link unless the code is in /sites.
Comment #5
pahariwalla CreditAttribution: pahariwalla commentedRe: performance -- The average from running microtime() 20 times with and without the patch show that the patch actually runs a little faster ... .07 vs. .09 seconds for the function to execute. I guess that's because it's processing fewer items.
Re: selection of core functions -- You're right about "/modules". It should be exclusive, .i.e not in "/sites" as opposed to must be in "/modules".
Since I'm new to Drupal, so I'm not sure if:
In testing my installation, I found that all of the functions which not in "/sites" were either in "/modules" or "/includes".
so the new patch has:
$isNotCore = stristr($func->getFileName(), realpath($_SERVER['DOCUMENT_ROOT'] . '/sites')) ? true: false;
instead of the old patch:
$isNotCore = stristr($func->getFileName(),realpath($_SERVER['DOCUMENT_ROOT']) . '/modules') ? false : true;
Thanks for taking the time.
Comment #6
pahariwalla CreditAttribution: pahariwalla commentedJust wondering what's going on with the patch... just realized I should have changed status to "needs review" ;-)
Comment #7
moshe weitzman CreditAttribution: moshe weitzman commentedThanks. Committed.