Sorry for repeating this subject. I have studied previous and similar questions but I have been unable to resolve the issue.

I have a module with set to version 7.x-0.1 and I'm trying to execute a simple hook_update_n - but it's not executing.

I read that the hook_update_n naming convent has to be specific so I changed my module version to 7.x-1.0

The code I'm using is as follows:

    function projecty_update_7101() {
    drupal_set_message("Executing Update#7101!");

I've tried a variety of number sequences but no joy.

The schema_version for my module in the systems database table is set to 0.

Can someone please tell me what I'm doing wrong?

  • Where are you putting the hook implementation? It needs to go in the module's .install file... – Clive Nov 8 '13 at 14:56
  • @Clive: yes, it's in the .install file. It's below the schema hook but I don't imagine that is the problem – sisko Nov 8 '13 at 14:58
  • And the module is called projecty (i.e. the file it's in is called projecty.install, and you've cleared the caches since adding the new hook? – Clive Nov 8 '13 at 14:58
  • @Clive: No. The install file is named projectY.install. The schema hook executed under that name though – sisko Nov 8 '13 at 15:01
  • Hmm it probably is running then, I guess the message is getting lost in the redirects. Try return 'test'; instead, that should give you a message when you get to the end of the update procedure (you can reset things by putting your module's schema back down to 0 in the database) – Clive Nov 8 '13 at 15:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.