Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295102

Throw an exception if the field doesn't exist in Schema::dropField

$
0
0

Problem/Motivation

If you see the first lines of the Schema::dropField() method you will see that if there is not field no exception is thrown.

    if (!$this->fieldExists($table, $field)) {
      return FALSE;
    }

Proposed resolution

Throw an exception like in the Schema::addField() method

    if (!$this->tableExists($table)) {
      throw new SchemaObjectDoesNotExistException(t("Cannot add field @table.@field: table doesn't exist.", ['@field' => $field, '@table' => $table]));
    }

But with the correct message.

Remaining tasks

Test the patch.

User interface changes

None.

API changes

Update the doc with the throw exception info.

Data model changes

None.


Viewing all articles
Browse latest Browse all 295102

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>