When I try to create a new content type I get this issue.
Fatal error: Call to undefined function _protected_node_node_type_validate() in \includes\form.inc on line 1432

If I disable protected_node, It will work properly.

What can I do?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

idflood’s picture

Status: Active » Needs review
FileSize
1.54 KB

I quickly stumbled upon this issue after configuring the module. Here is a simple patch that should fix the issue. It makes the assumption that if $node->protected_node_is_protected is not set then the node type is configured to "never protected".

edit: wrong issue...

idflood’s picture

Status: Needs review » Active
Syd Barrett’s picture

So?is it the right patch or not?

idflood’s picture

Syd Barrett’s picture

Ok, thanks anyway :)

zilverdistel’s picture

Priority: Critical » Major
Status: Active » Postponed (maintainer needs more info)

Hi Syd,

I couldn't get to reproduce this error on a fresh drupal installation, with only protected_node installed (and some basic dev modules like views ..).

Also, since there's no data loss involved with this bug, priority isn't critical.

Greetz,

Diederik

Syd Barrett’s picture

Thank you zilverdistel,

Probably is a conflict with some other module. I will give you more information once I got it.

Thank you.

avantwaves’s picture

Same problem here... the error that I get is:
PHP Fatal error: Call to undefined function _protected_node_node_type_validate() in /httpdocs/includes/form.inc on line 1443
I am trying to solve the problem... (I don't know exactly how xD ) and I will report back.

bluewallmedia’s picture

When this error exists, and you go to configure the module here....

http://mysite.com/admin/config/content/protected_node

My drupal install returned this error...

Fatal error: Call to undefined function _user_password_dynamic_validation() in /mysite/sites/all/modules/protected_node/protected_node.settings.inc on line 297

I can also confirm that by un-installing this module fixes the issue with not being able to create a content type in Drupal 7.14.

I'm happy to test any patches for D7.

akolahi’s picture

I'm having the same error message as #9 when i try to visit admin/config/content/protected_node

***edit***

I just noticed that i can add a new content type, but I still can't visit the admin page (admin/config/content/protected_node) so my issue may be different.

rgme’s picture

I have had both problems mentioned in this issue, and here are the solutions/bandages I am using. Please let me know if I'm messing things up by doing this (especially #2). I don't know how to do the whole patching thing, so I'll just describe what I did. (Not the most graceful solutions, but they seem to get the job done.)

  1. Node type edit/creation returns Fatal error: Call to undefined function _protected_node_node_type_validate() in \includes\form.inc on line XXXX.
  2. Looking in protected_node_settings.inc, it looks like this function works with the default password feature. I don't really need this feature, so I commented out line 737:
    $form['#validate'][] = '_protected_node_node_type_validate';
    Since I messed with the feature, I just took it out, from lines 714-722:

      $form['protected_node']['protected_node_node_type_password_field'] = array(
        '#type' => 'password_confirm',
        '#description' => t('Enter a node type password. This password is the default for all the nodes of this type.'),
        '#size' => 20,
        '#after_build' => array('protected_node_autocomplete_off'),
        '#title' => t('A default (global) password for nodes of this type'),
        // No default value.
        /* '#default_value' => variable_get('protected_node_node_password_' . $form['#node_type']->type, ''), */
      );

    I can create and edit content types without errors. I hope everything behind the scenes is still working.

  3. Trying to access the protected node settings page returned Fatal error: Call to undefined function _user_password_dynamic_validation() in /mysite/sites/all/modules/protected_node/protected_node.settings.inc on line 297.
  4. This one is documented here, with solutions in comments #1 and #7. Basically, comment out/delete line 297.

Again, please let me know if these things will mess up any functionality/database stability. So far it seems to work for me.

hugronaphor’s picture

In my case I can't edit any Content Types with enabled module `node location` from location module (http://drupal.org/project/location ).
Commented line 737 ( $form['#validate'][] = '_protected_node_node_type_validate'; ) , seems to fix that.

Grimreaper’s picture

Hello,

I have just tested a fresh installation as zilverdistel and I don't have any bug.

I also test the problem in comment #12. I don't have any bug.

Maybe those problems where fixed between the moment you reported its and now ?

izus’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

i cannot reproduce it too
closing as maybe this was fixed meanwhile

maxlmator’s picture

Status: Closed (cannot reproduce) » Needs review
FileSize
918 bytes

I ran into the same issue and was able to create a fix that does not skip the validation altogether.

Instead of using module_load_include(), form_load_include() will ensure that the settings.inc is always included when the form is loaded.

This does fix this error for me and is probably also generally the better way to include the settings.inc?

(This is my first comment / patch and I hope, it's done correctly.)

Grimreaper’s picture

Status: Needs review » Postponed (maintainer needs more info)

Hello,

I'm sorry but I just make a fresh install of a last version of Drupal with the last code base of the module. And I don't have any error.

So I don't test your patch, even if I think it will not break anything.

Please could you give simple steps to reproduce the error.

Thanks

maxlmator’s picture

I can reproduce it, when having location_node installed and enabled as #12 already mentioned.

Steps to reproduce:

  • Fresh drupal installation (7.24)
  • Install & activate protected_node
  • Install location
  • Activate location and location_node
  • Try to edit or create a content type -> Fatal Error

The error message:
Fatal error: Call to undefined function _protected_node_node_type_validate() in <Drupal-Dir>/includes/form.inc on line 1471

I'm well aware of the chance that this problem might be caused by the location module but I wasn't able to pinpoint it to any specific call there.

Grimreaper’s picture

Title: When protected_node is enabled I cannot create a new content type. » Support location
Assigned: Unassigned » Grimreaper
Category: Bug report » Support request
Status: Postponed (maintainer needs more info) » Needs review

Ok thank you, I forget the location project mentionned in the comments.

I refresh the title and tags of the issue to be more self-expressive.

I will try your patch between today and the end of the weekend.

Grimreaper’s picture

Status: Needs review » Reviewed & tested by the community

I can reproduce the bug.

I test the patch and it solves the problem.

BUT : I also notice that the maintainer of location said that the modules :
node locations,
user locations
(and I think probably location taxonomy, why not all the entities)
are deprecated and it is location CCK (which will become location field) which is to be used.

I test without applying your patch with location CCK and it works.

Also I can't see how node locations, etc. works because I don't see any config options added anywhere. I think those modules are still present only for transition and they will be removed soon.

So I don't know, if the maintainer wants to merge your patch ok, if not, I think the issue is closed.

maxlmator’s picture

Thanks for pointing out the roadmap of the location module. I wasn't aware of it.

However, leaving the location module aside I still think that form_load_include() is the better way for dealing with includes in Drupal forms.
Like the documentation already says:

Use this function instead of module_load_include() from inside a form constructor or any form processing logic as it ensures that the include file is loaded whenever the form is processed. In contrast to using module_load_include() directly, form_load_include() makes sure the include file is correctly loaded also if the form is cached.

Maybe it's better to start a separate ticket and discussion for this?

Grimreaper’s picture

I think it will be merged in this issue. There is no need to open a new one.

Thanks.

izus’s picture

Assigned: Grimreaper » Unassigned
Status: Reviewed & tested by the community » Fixed

#15 is merged in 7.x-1.x
Thank you all

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.