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.
By jesterFortyEight on
I have an admin form for managing 3 specific content types, i want to load an empty node of the specific content type when so that i can still do
$form['conten_type_name'] = array(
'#type' => 'textfield', //you can find a list of available types in the form api
'#title' => t(' Name:'),
'#size' => 20,
'#maxlength' => 50,
'#default_value' => $content_type->name ,
);
I want to avoid errors and warnings related to invalid call on non object.