Hi,
I looked up through all Drupal 7(8) core files and found a list of bugs and typos:
1. drupal_valid_path() has undefined variable $form_item.
2. In _theme_table_cell() in case when $cell is not an array variable $attributes might be undefined.
3. In update_fix_d7_install_profile() variable $file is undefined and unnecessary incorrect: See #1479572-5: Fix undefined variable error in update_fix_d7_install_profile().
4. Updater::prepareInstallDirectory has undefined $install_location.
5. Updater::update calls Updater::makeBackup() function with 2 arguments but it requires three.
6. In drupal_var_export() is a concatination to undefined variable $output in this case:
elseif (is_object($var) && get_class($var) === 'stdClass') {
// var_export() will export stdClass objects using an undefined
// magic method __set_state() leaving the export broken. This
// workaround avoids this by casting the object as an array for
// export and casting it back to an object when evaluated.
$output .= '(object) ' . drupal_var_export((array) $var, $prefix);
}
7. In DatabaseStatementPrefetch::current PHP function array_unshift() are used incorrectly (required second parameter is missing):
case PDO::FETCH_CLASS | PDO::FETCH_CLASSTYPE:
$class_name = array_unshift($this->currentRow);
And the second bug here. Variable $k is undefined:
case PDO::FETCH_COLUMN:
if (isset($this->columnNames[$this->fetchOptions['column']])) {
return $this->currentRow[$k][$this->columnNames[$this->fetchOptions['column']]];
}
else {
return;
}
8. In field_sql_storage_field_storage_query() variables $select_query and $field_base_table are undefined in this case:
if ($key) {
$select_query->join($tablename, $table_alias, "$table_alias.entity_type = $field_base_table.entity_type AND $table_alias.$id_key = $field_base_table.$id_key");
}
Edit by chx: this is a loop over a list (array with int keys starting from 0) and the !$key case will always come first which defines these variables.
9. In field_test_field_attach_delete_bundle() variable $bundle_old is undefined.
10. hook_field_delete() and hook_field_delete_revision() has wrong example of API usage: function file_field_delete_file() takes at least 4 arguments, but in documentation of this hooks file_field_delete_file() takes only 2 arguments.
11. In image_effect_definitions() I'm not sure that $cache->data is ready to check in the if clause:
if ($cache = cache_get("image_effects:$langcode") && !empty($cache->data)) {
$effects = $cache->data;
}
12. In documentation of hook_node_grants_alter() variable $user is undefined.
13. In documentation of hook_prepare() function file_check_upload() are deprecated since Drupal 6. Variable $field_name is undefined. Function _image_build_derivatives() is deprecated since Drupal 7.
14. In search_index() in case when $tag is FALSE variable $linktitle is undefined.
#1: #876580: drupal_valid_path fails for dynamic paths (e.g. user/% cannot be added to menus)
#2: -- (looks fine to Droplet, see comment #7)
#3: #1479572: Fix undefined variable error in update_fix_d7_install_profile()
#4: #1423510: Undefined var in prepareInstallDirectory
#5: #1476804: Updater::update calls Updater::makeBackup() function with 2 arguments but it requires three
#6: #1476776: drupal_var_export() is a concatenation to undefined variable $output
#7: #1476782: DatabaseStatementPrefetch::current PHP function array_unshift() are used incorrectly
#8: FIXED (see above chx's comment)
#9: -- (needs work)
#10: #1476812: hooks file_field_delete_file() takes only 2 arguments
#11: #1469758: Define $user in hook_node_grants_alter
#12: #1469758: Define $user in hook_node_grants_alter
#13: -- (needs work)
#14: #1479618: $linktitle is undefined in search_index()
Comments
Comment #0.0
spleshkaFixed typo in a word 'used'.
Comment #0.1
spleshkaAdded bracers to some functions.
Comment #0.2
oriol_e9gFixed typo.
Comment #1
oriol_e9gFix first in D8 and in a separate issues.
4) #1423510: Undefined var in prepareInstallDirectory
Comment #2
andypostgood bunch of notices! actually they should be filed as separate issues with
NoviceandQuick fixtags and checked for backportability...Comment #3
jody lynn#1: #876580: drupal_valid_path fails for dynamic paths (e.g. user/% cannot be added to menus)
Comment #4
chertzog#12 addressed here #1469758: Define $user in hook_node_grants_alter
Comment #4.0
chertzogSome typos were fixed.
Comment #4.1
chx commenteddeleted 8
Comment #5
chx commentedTo keep this issue manageable I edited the original node (which crossing out a bogus report).
Comment #6
droplet commented#6 #1476776: drupal_var_export() is a concatenation to undefined variable $output
Comment #7
droplet commented#1: -- (needs work)
#2: -- (Looks fine to me)
#3: -- (needs work)
#4: #1423510: Undefined var in prepareInstallDirectory
#5: #1476804: Updater::update calls Updater::makeBackup() function with 2 arguments but it requires three
#6: #1476776: drupal_var_export() is a concatenation to undefined variable $output
#7: #1476782: DatabaseStatementPrefetch::current PHP function array_unshift() are used incorrectly
#8: FIXED
#9: -- (needs work)
#10: #1476812: hooks file_field_delete_file() takes only 2 arguments
#11: #1469758: Define $user in hook_node_grants_alter
#12: #1469758: Define $user in hook_node_grants_alter
#13: -- (needs work)
#14: -- (needs work)
Comment #8
chertzog#3 Addressed here #1479572: Fix undefined variable error in update_fix_d7_install_profile()
Comment #8.0
chertzogDeleted 4 and 12
Comment #8.1
droplet commentedupdate fixed issue
Comment #8.2
droplet commentedadd #14 issue thread
Comment #9
droplet commentedIssue summary updated.
#2, (SOLVED) predefined
#9, #13 is doc issue, needs seek a better / up-to-date example code$attributes = '';in function. so not a problemComment #9.0
droplet commentedadd #1
Comment #9.1
pillarsdotnet commentedLink to issue for #3.
Comment #10
polRegarding issue 9 (In field_test_field_attach_delete_bundle() variable $bundle_old is undefined), I gave a look at it this morning.
The test is this:
And it doesn't pass the line:
because the variable
$fieldis NULL.Now I don't have enough skills to go further... I'm still digging.
Comment #11
droplet commented@Pol,
I think someone just copy the rename function and paste into delete_bundle.
https://api.drupal.org/api/drupal/modules%21field%21tests%21field_test.s...
It can remove the IF condition.
Comment #12
pol@droplet, ah ok, that makes sense... I'll try to create a new test then, but first, I gotta read the field API ;-)
Comment #13
valthebaldWe are going to work on this issue during DCWroclaw 2014
Comment #14
manningpete commentedRemoving Novice tag.
There's nothing specific for a Novice to do on this.
Novice tag documentation: https://www.drupal.org/core-mentoring/novice-tasks
Comment #15
yesct commentedthis is kind of an unusual meta... it is not really a list of all bugs and typos, but just a list found by this one person so they could track solving each separate thing. (having separate issues is great.)
retitling.
we could close this and just leave the individual issues open on their own as appropriate. ... yeah doing that.