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.
Comment | File | Size | Author |
---|---|---|---|
#16 | 2367745-16.patch | 871 bytes | Palashvijay4O |
#4 | 2367745-4.patch | 3.18 KB | Palashvijay4O |
Comments
Comment #1
gumanist CreditAttribution: gumanist commented$ git grep drupal_var_export
core/includes/utility.inc:function drupal_var_export($var, $prefix = '') {
core/scripts/dump-database-d6.sh:// Include the utility drupal_var_export() function.
core/scripts/dump-database-d6.sh: $output .= "db_create_table('" . $table . "', " . drupal_var_export($data) . ");\n";
core/scripts/dump-database-d6.sh: $insert .= '->values('. drupal_var_export($record) .")\n";
core/scripts/dump-database-d6.sh: $output .= "db_insert('". $table . "')->fields(". drupal_var_export(array_keys($data['fields'])) .")\n";
core/scripts/dump-database-d7.sh:// Include the utility drupal_var_export() function.
core/scripts/dump-database-d7.sh: $output .= "db_create_table('" . $table . "', " . drupal_var_export($data) . ");\n";
core/scripts/dump-database-d7.sh: $insert .= '->values('. drupal_var_export($record) .")\n";
core/scripts/dump-database-d7.sh: $output .= "db_insert('". $table . "')->fields(". drupal_var_export(array_keys($data['fields'])) .")\n";
Comment #2
gumanist CreditAttribution: gumanist commented$ git grep drupal_var_export
core/includes/utility.inc:function drupal_var_export($var, $prefix = '') {
core/scripts/dump-database-d6.sh:// Include the utility drupal_var_export() function.
core/scripts/dump-database-d6.sh: $output .= "db_create_table('" . $table . "', " . drupal_var_export($data) . ");\n";
core/scripts/dump-database-d6.sh: $insert .= '->values('. drupal_var_export($record) .")\n";
core/scripts/dump-database-d6.sh: $output .= "db_insert('". $table . "')->fields(". drupal_var_export(array_keys($data['fields'])) .")\n";
core/scripts/dump-database-d7.sh:// Include the utility drupal_var_export() function.
core/scripts/dump-database-d7.sh: $output .= "db_create_table('" . $table . "', " . drupal_var_export($data) . ");\n";
core/scripts/dump-database-d7.sh: $insert .= '->values('. drupal_var_export($record) .")\n";
core/scripts/dump-database-d7.sh: $output .= "db_insert('". $table . "')->fields(". drupal_var_export(array_keys($data['fields'])) .")\n";
Comment #3
Palashvijay4O CreditAttribution: Palashvijay4O commentedComment #4
Palashvijay4O CreditAttribution: Palashvijay4O commentedTest patch .
Comment #5
dawehnerI always thought that these scripts run under d6/d7 itself, can you clarify whether they still work?
Comment #6
dawehnerThese usages are actually valid as they are executed in the context of Drupal 6 / 7 if I understand it correctly.
Comment #7
chx CreditAttribution: chx commentedThose scripts might be needed to create tests for D8 -> D8 migrations when we get there.
Comment #8
chx CreditAttribution: chx commentedAnd this looks great, thanks for the patch.
Comment #9
alexpottI can't find a change record for the creation of the
Variable
class and the deprecation ofdrupal_var_export()
. #2022931: Move drupal_var_export() to \Drupal\Component\Utility does not reference one and searches reveal nothing. Can some on add one (https://www.drupal.org/node/add/changenotice) and link to this issue and that one.Comment #10
chx CreditAttribution: chx commentedChange notice has been written, thanks Palashvijay4O
Comment #11
tstoecklerHehe, these scripts are always fun. :-)
I'm pretty sure @dawehner is correct in #6 that these scripts are not to be run from a D8 install.
That is verified by the D6 one containing
db_fetch_array()
which doesn't exist in D8. Sadly, both scripts already contain\Drupal::moduleHandler()->getModuleList()
.So, not really sure what to do here.
Comment #12
alexpottYep do not change these files - these are d6 and d7 code. So could be "closed won't fixed". But now we can get on with the removal of the
drupal_var_export
function. So let's repurpose this issue. Since @Palashvijay4O already made the nice CR and attached it to this issue.Comment #13
chx CreditAttribution: chx commented> Yep do not change these files - these are d6 and d7 code.
D7. D6 didnt have drupal_var_export AFAIK.
Comment #14
jamesdixon CreditAttribution: jamesdixon commentedIn that case the only file left we may need to change is:
Should we remove the function from utility.inc?
Comment #15
alexpottYes
Comment #16
Palashvijay4O CreditAttribution: Palashvijay4O commentedOk . Removed the function.
Comment #17
tstoecklerYup, awesome.
Comment #18
alexpottThis issue is a prioritized change (deprecated function removal) as per https://www.drupal.org/core/beta-changes and it's benefits outweigh any disruption. Committed 40b2f16 and pushed to 8.0.x. Thanks!