Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
I was wondering what is the use of the machine_name key in the mentioned hook. I noticed that the following code doesn't work:
function cr_info_cdn_unique_file_identifier_info(){
$identifier['cr_deploy_mtime_compare'] = array(
'label' => t('Most recent of Deployment Date or MTime'),
'machine_name' => 'some_machine_name',
'description' => t('Uses the most resent of either the deployment or the modification time of the file'),
'filesystem' => TRUE,
'callback' => '_cr_info_deploy_mtime_compare',
'prefix' => 'deploymtime',
);
}
This is because the key returned array key 'cr_deploy_mtime_compare' does not match the machine name 'some_machine_name' (see line 232 in cdn.basic.farfuture.inc file). If these 2 keys need to be identical why do we use a machine name anymore?
Comment | File | Size | Author |
---|---|---|---|
#3 | 1434358-3_D7.patch | 2.96 KB | Wim Leers |
Comments
Comment #1
Wim LeersGood find. I'll look into this. Seems like a design fail on my behalf.
Comment #2
andreiashu CreditAttribution: andreiashu commentedCorrect me if I'm wrong but I think the machine_name key was meant so that we can use it as a UFI identifier in the 'cdn_farfuture_unique_identifier_mapping' variable.? This is what I thought initially.
Which means that, given the above implementation of an identifier, I should be able to have this in my textarea mapping:
Comment #3
Wim LeersDesign fail it is. Currently, the array key *must* match the machine name. Patch for D7 attached. Probably applies to D6 as well.
Comment #4
Wim LeersCommitted the patch in #3.
D7: http://drupalcode.org/project/cdn.git/commit/143e46e
D6: http://drupalcode.org/project/cdn.git/commit/87e1c56