Skip to content

Commit

Permalink
Merge pull request #20 from herbdool/issue-19
Browse files Browse the repository at this point in the history
Issue #19 check that node type exists
  • Loading branch information
robertgarrigos authored Jan 1, 2024
2 parents aaa32f1 + 28f3710 commit bdbe2fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion references_dialog.dialog_widgets.inc
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function references_dialog_node_reference_add_link($element, $widget_settings, $
foreach ($field['settings']['referenceable_types'] as $type => $active) {
if ($active !== 0) {
$node_type = node_type_load($type);
if (node_access('create', $node_type->type)) {
if ($node_type && node_access('create', $node_type->type)) {
$add_links[] = array(
'title' => t('Create @type', array('@type' => $node_type->name)),
'href' => 'node/add/' . strtr($type, array('_' => '-')),
Expand Down

0 comments on commit bdbe2fc

Please sign in to comment.