I was working on my own node type called getoknow. On the front page, as a block at the bottom, it displays the title and a teaser along with an uploaded picture and it links to 'getoknow/[nid]' where [nid] is the node id. This link goes to a custom page that displays the getoknow node first followed by the rest of the getoknow nodes as title/teasers which can be clicked on to display them first too.

Anyway, when I tried to update to drupal 5 rc1 I ran into a few problems. After getting everything changed that needed to be (according to the module 4.7 to 5.0 page) When i click on the link from the first page all I get is a page not found error from drupal. I can't seem to figure out what happened. Everything seems to work ok except for this link issue.

How can I customize a specific page link that drupal will recognize? At least I think that's what I want to know.

Sorry, I realize this may be difficult to understand what I'm asking so please ask for futher explaination if needed.

Comments

xjm’s picture

1. Do you have clean URLs on or off? If they're not enabled, you'll need the ?q= in your relative URL.
2. Is your base URL set correctly? (If you've never set it and you only have one site it's probably fine.)
3. What happens if you use the absolute link to the node instead of the relative one? (e.g. http://mysite.org/blah.../getoknow/[nid])

It might help to post an example of what the actual page address is when you visit one of the getoknow nodes, versus an example of the actual page address when you get the "not found" error after clicking on one of the links.

=======================
Just another newbie.
XHTML Strict: it's the way to be.
=======================
Feature request: HTML Source Formatting in TinyMCE

jonathanchris’s picture

Well,

  • I do have clean urls
  • my base url is fine
  • and I went ahead and tested this one out, but it didn't make a difference, my links are fine.

I'm going from the front page which is http://localhost/heidelberg2/ to http://localhost/heidelberg2/getoknow/[nid]. My guess is that I have some function not making a connection between this node and the address. It's weird 'cause I had it working perfectly, except for some minor details, but then when I started tweaking it to get it to look the way I wanted, all of the sudden I got the 'page not found' (and before anyone asks yes I backtracked my steps, but no help). The last thing I had done was update the actual node, after changing the amount of trailer, so that the trailer for the front page was a different length. After doing this I can't get it to work at all, and I've tried reinstalling drupal, so I know the error is still in my module code.

xjm’s picture

So it sounds like your module just isn't retrieving the node information properly (or isn't getting a chance to). Maybe the "not found" handler is getting called before your module has a chance to dish out the right content? Does your module call a "not found" handler? That's the first thing I'd check--after maybe testing whether the getoknow module is getting used at all when you visit the link.

=======================
Just another newbie.
XHTML Strict: it's the way to be.
=======================
Feature request: HTML Source Formatting in TinyMCE

jonathanchris’s picture

I think you might be onto something. Unfortunately I'm not sure how to make a "not found" handler. If you have the link where they explain this I'd appreciate it.

Also I noticed something when I was checking the database. Under the node_type table there is no entry for my getoknow type. There is one for story, page, and blog but not getoknow. I wasn't sure if this was because those modules came with drupal or if I'm missing an important function that is leaving this out.

Thanks again for the help!

xjm’s picture

Well, in 4.7 some modules (including node.module) call a drupal_not_found() function when they determine it's appropriate. If you didn't set up anything special I assume the node module is handling this for you. So, to trace the problem from the observed result (Page not found error) back to its source (the bug), you could try to figure out what in your code is making the node module execute a branch of code that calls that function (or its 5.0 equivalent; I'm not sure if it's handled the same way in drupal 5).

I don't have a node_type table in my instances of 4.7.3 and 4.7.4... maybe this is a change in version 5? Hopefully someone familiar v5 can clarify.

If I understood correctly--you mentioned that the problem started sometime after you upgraded to 5, right? That could mean it's a difference between 4.7 and 5 that's causing troubles.

=======================
Just another newbie.
XHTML Strict: it's the way to be.
=======================
Feature request: HTML Source Formatting in TinyMCE