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.
I got this error after removing a content type
Notice: Undefined property: stdClass::$old_type in nodeformcols_node_type_delete() (line 179 of C:\xampp\htdocs\drupal\sites\all\modules\nodeformcols\nodeformcols.module).
Comment | File | Size | Author |
---|---|---|---|
#1 | nodeformcols.patch | 1.13 KB | devuo |
Comments
Comment #1
devuo CreditAttribution: devuo commentedApparently the module was relying on a variable that wasn't available (core changes probably) onto the passed Array to the implementation of hook_node_type_delete and hook_node_type_update. The patch I'm submitting solves the issue by changing the variable name to another, that does exist, on the passed array.
The problematic variable $old_type was swapped for $orig_type.
The patch was generated relative to the module folder, so it should be applied at the root folder of the module.
Comment #2
asherry CreditAttribution: asherry commentedThis was actually fixed in http://drupalcode.org/project/nodeformcols.git/commit/aa3354bef5bb816201...
It wasn't a problem with orig_type being swapped for old_type though, those are completely different values. orig_type is meant to be the content type machine name that is saved originally on insert.
There is another drupal core issue where this is being overridden in a default function, that's here:
https://drupal.org/node/2219177
The fix for this was to change it to $info->type, as whatever the current machine name is for the content type we want to delete the associated variable.