After initially setting up minutes content type, unable to edit

rconstantine - March 14, 2009 - 10:03
Project:Minutes
Version:6.x-1.0-beta1
Component:Code
Category:bug report
Priority:normal
Assigned:rconstantine
Status:needs review
Description

I had to change the beginning of the following function by adding the check for the path.

function minutes_form(&$node) {
  if (arg(0) == 'admin' && arg(1) == 'content' && arg(2) == 'node-type' && arg(3) == 'minutes') {
    return;
  }

It probably only needs the arg(3) check and not the others. The problem was that when I would browse to the path admin/content/node-type/minutes, I would get the same error as when trying to go to node/add/minutes. It doesn't make sense to me since the hook_form should only be called for that second URL and not the first one. Is anyone else seeing this problem?

#1

ano1 - May 24, 2009 - 01:01

I have been able to edit my minute nodes and content type without any changes to the module. What specifically were you trying to do to the node?

#2

rconstantine - May 26, 2009 - 19:54

It has been quite some time since I posted the issue, so I'm having trouble remembering the conditions, but I think there was no problem creating minutes when using the links from the node to which the minutes should be attached, nor was there a problem later editing those minutes.

As I recall, when one browses to node/add, the minutes are not listed there - as they should not. And that directly entering in node/add/minutes results in an error page of some kind. This is as expected.

What I was trying to do was go to the administrative screen for the module. I could not. Going to the admin screen with the path of admin/content/node-type/minutes resulted in the same error as trying to create a minutes node without going through an existing node. So you see, this has nothing to do with minutes node creation or editing, but rather just the administrative screen.

Since the hook_form should only be operating on one form, it might be better to use hook_FORM-ID_form (or whatever it is), a new hook which allows for targeting just one form. Check the API site for more info on that.

In summary, I couldn't access the administration screen until I made the above change. I offered another alternative above by using another hook.

 
 

Drupal is a registered trademark of Dries Buytaert.