Thanks, nice module and I will be playting with it in anger this wekeend so might be back with more (hopefully not!) but here is one.

I installed the latest version which was downloaded 20 mins ago.

I installed and after creating some vocabulary I went to create an ad. There are two 'Classified Ads' links under Create content. I can obvioulsy disable one of them but wanted to point it out to help improve the module.

I will likely be trying to play with the menus as I would like to have a single Classified Ads menu with two children; Create Ad and Search Ads. Anyway, onwards and upwards!

Thanks again,
Paul

CommentFileSizeAuthor
#6 Drupal_ScreenShot.gif69.45 KBgatman
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mcurry’s picture

I've noticed the double navigation menu entry - I'll see if I can figure out what's wrong.

Enjoy!

friskya’s picture

I also noticed it.

One is "ed-classifieds", the other is "ed_classifieds".

Since the link outside the "create content" menu uses the underscore, rather than the hyphen, I kept that one and disabled the other.

Just a quick workaround, for anyone else who might need it.

mcurry’s picture

Yeah, that's a strange one, that's what happens here, too - and yet, the string "ed-classified" doesn't appear anywhere in my source code, so I'm at a loss to explain it...

gatman’s picture

Same on the menu - using PHP 5 here.

Also experiencing two entries as well. These are observed under Category: Some Cat => Latest ad => User Name

URL: http://domain/node/14

Thanks!
John

mcurry’s picture

Same on the menu - using PHP 5 here.

Also experiencing two entries as well. These are observed under Category: Some Cat => Latest ad => User Name

URL: http://domain/node/14

I'm not sure what you are referencing. Can you provide a real URL to the site exhibiting this problem, or a attach screen capture (please compress/reduce in size, or crop, as I'm on a slow dialup connection).

Thanks

gatman’s picture

FileSize
69.45 KB

Duplicate data in addition to duplicate Create Content

Here is screen shot

Using PHP5

Thanks
John

mcurry’s picture

Thanks for the screen shot.

Please open a separate bug/issue for the 'duplicate content' issue, and attach this screen shot to that issue as well.

mcurry’s picture

gatman, I've committed some fixes for the double content issue. Please install 5.x-1.5-4 release and see if that fixes it for you.

I've opened a separate issue for this: http://drupal.org/node/123894

demeritcowboy’s picture

It's coming from node_menu in node.module. This part:

foreach (node_get_types() as $type) {
if (function_exists($type->module .'_form')) {
$name = check_plain($type->name);
$type_url_str = str_replace('_', '-', $type->type);
$items[] = array(
'path' => 'node/add/'. $type_url_str,
'title' => drupal_ucfirst($name),
'access' => node_access('create', $type->type),
);
}
}

I don't know enough about drupal to know what the right fix is and I really don't understand the rational for the _ to - conversion above.

demeritcowboy’s picture

(By "rational" of course I meant "rationale")

Also node_add() does the same thing, so there needs to be some kind of fix for that too, otherwise on the "?q=node/add" page the link has a hyphen too.

mcurry’s picture

'demeritcowboy': Thanks for doing the investigation.

Does anybody have any idea why the drupal core is doing this in 5.x? Does this mean that any module that embeds '_' in the node type will break?

BIzarre!

demeritcowboy’s picture

As far as I can see it's because the founder of drupal doesn't like underscores in urls. See comment #131 in http://drupal.org/node/62340.

So one solution is to just let them do this, and take the link out of your hook_menu(). Although I notice that if you have lm_paypal installed that module doesn't seem to work properly with the "-" version of the link, so you probably eventually need to rewrite everything not to have an underscore.

mcurry’s picture

As far as I can see it's because the founder of drupal doesn't like underscores in urls

I'll wait a while and see where this goes.. seems like any node type name with an underscore in the name is asking for trouble, though. Yuck.

mcurry’s picture

I wonder how this affects lm_paypal, amazon_node (amazon associates tools) and other module names/node types with underscores in them? Perhaps I've just neglected something in my port to Drupal 5...

demeritcowboy’s picture

I don't think the module name matters too much, but since the decision seems to have been arbitrary according to that thread, who's to say they won't arbitrarily decide later to break those too. What I meant was that if you're using lm_paypal as a way to require payment for the classified ads, clicking on the "-" version of the classified ad creation link doesn't seem to give you the exact right form, and you can create the ad without a subscription.

I haven't looked more into it since lm_paypal didn't really fit my needs anyway.

sniper08’s picture

Can I comment out

$items[] = array(
                     'path' => 'node/add/' . EDI_CLASSIFIED_MODULE_NAME,
                     'title' => $name,
                     'access' => user_access('create classified ads'),
                     );

from function ed_classified_menu($may_cache) as a temporary fix?

Willdex’s picture

Just following up on this post since I'm also confused about the "node/add/ed-classified" vs "node/add/ed_classified."

mcurry’s picture

Status: Active » Postponed (maintainer needs more info)

@sniper08, you can try that workaround, but I'm not sure what's going on so I can't really comment on it.

@all: I'll dig into this a bit more since I am now looking into Drupal 5 issues in this module.

In the meantime, you can disable the incorrect menu item in admin/build/menu as a simple fix, can't you?

mcurry’s picture

Title: duplicate menu entry in Create Content » duplicate menu entry in Create Content; drupal changes '_' to '-' in URL paths.
Assigned: Unassigned » mcurry
Status: Postponed (maintainer needs more info) » Fixed

Proposed fix checked in @ http://drupal.org/cvs?commit=67075

If I can't beat them, I'll join them. Since drupal node.module insists on changing '_' to '-' we'll just use '-' in all URL paths defined by this module. Bizarre, but I'm not going to ask why node.module does this - since it appears to be 'by design'...

Please wait for the next Drupal 5.x-1.x-dev snapshot build (it may take up to 12 hours for the next build, so please look for a version with a date newer than April 9 2007).

I would like to hear some feedback on this new version - look for any broken links, etc. since I've changed the URLs from 'ed_classified' to 'ed-classified'. If I don't hear of any issues with this -dev version, I'll create a new release in a few days (perhaps longer).

If you have an established site with links to any 'ed_classified' URLs, you might want to create some path aliases to the new form of the URL, and consider using the 'global redirect' module in order to prevent any 404 errors. (In other words, on a production site, watch for any 404 errors and try to mitigate them.)

mcurry’s picture

Proposed fix checked in @ http://drupal.org/cvs?commit=67075

If I can't beat them, I'll join them. Since drupal node.module insists on changing '_' to '-' we'll just use '-' in all URL paths defined by this module. Bizarre, but I'm not going to ask why node.module does this - since it appears to be 'by design'...

Please wait for the next Drupal 5.x-1.x-dev snapshot build (it may take up to 12 hours for the next build, so please look for a version with a date newer than April 9 2007).

I would like to hear some feedback on this new version - look for any broken links, etc. since I've changed the URLs from 'ed_classified' to 'ed-classified'. If I don't hear of any issues with this -dev version, I'll create a new release in a few days (perhaps longer).

If you have an established site with links to any 'ed_classified' URLs, you might want to create some path aliases to the new form of the URL, and consider using the 'global redirect' module in order to prevent any 404 errors. (In other words, on a production site, watch for any 404 errors and try to mitigate them.)

mcurry’s picture

Sorry for the double post - my internet connection dropped out after the first post, I hit refresh, and now we have two posts.

Anonymous’s picture

Status: Fixed » Closed (fixed)
mcurry’s picture

Assigned: mcurry » Unassigned