A menu is made automatically too, how to prevent?

DanielTheViking - July 27, 2006 - 13:45
Project:Prepopulate
Version:4.7.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

(Related to both CVS and 4.7.0. See note at the bottom.)

I am using the CVS version with Drupal 4.7.2 as the 4.7.0 version does not work properly. CVS works in terms of populating the fields, BUT:

When posting, using the [title] field, Drupal 4.7.x enters the title text in both the Menu section, because that field is actually called "title", and in the subject field (the actual "title" of the post). This is the same for both forum posts and blog posts, and probably any node. So unless you expand the Menu section and delete/adjust the value in the Menu Title field (the whole title of the web page in question is put there), then Drupal makes not only a new post, but a new menu entry with that title too.

I tried to "guess" that I could use "subject" to get the title only placed in the Subject field, but that does not work. Is the menu module intervening with its magic tricks here?

How to get around this?
(is this really a "bug" that needs to be fixed , or can we get by with a "workaround"?)

Note:
I think it is a bit "misleading" that there is a 4.7.0 version that does not work and still has no "bugs reported", so I file this in 4.7.0 to notify other users both about this issue and to point them to use the CVS version until the 4.7.0 version has been fixed. Could save many users some time if this is visible.

#1

eafarris - July 27, 2006 - 13:56

Can you post an example of the URL that you're using?

It should be something like http://drupalsite.com/node/add/blog?edit[title]=something

(And yes, the versioning is kinda screwed up, my CVS newbieness is showing. We'll consolidate the releases for 4.8/5.0).

#2

DanielTheViking - July 27, 2006 - 14:25

Yes, it is such an URL as you are referring to there. The point is that the edit[title] inserts the content both into the Subject and into the Menu Title field.

I guess this happens only for uses with the permissions to administer menus, though. Without that permission, there is only one field to put it in, then it possibly works ok. So maybe this is a Admin/ContentManager-only issue.

#3

kirkcaraway - August 23, 2006 - 23:39

I'm having the same problem, too. I am using Drupal 4.7.3, with the newest CVS version of prepopulate. I am using a javascript bookmarklet to allow automatic quoting of material in blog posts.

Thanks for any help you can offer.

#4

DanielTheViking - August 26, 2006 - 09:24

Can somebody give a clue as of what is technically happening and if there is a possible workaround for this until the module itself works properly?

For example, after the javascript code has successfully filled in all the fields, and including the Menu Title field, is it possible to set the JS to locate and delete the entry in the Menu Title field without actually deleting the Subject, or is it so that this error would make the module delete both too (ie. that there are no distinct way of locating only the Menu Title field?)
But of course, if there was a way of getting to _only_ the Subject field itself, then we would probably manage to ensure that nothing was put erroneously in the Menu Title field in the first place...

#5

eafarris - August 26, 2006 - 14:45

The problem is a bug in prepopulate's array walking code. It is setting the menu title and the node title because it is not differentiating between the variables $edit[title] (the node title) and $edit[menu][title] (the menu title).

It will be a while before I can give this some attention, but patches are always welcome.

#6

eafarris - August 28, 2006 - 22:45
Status:active» fixed

This is fixed in HEAD, thanks to the beautiful patch by egfrith at #55403.

#7

Anonymous - September 11, 2006 - 23:02
Status:fixed» closed
 
 

Drupal is a registered trademark of Dries Buytaert.