I've found that if I have a hyphen in a category's name, in this case 'app-suggestions', then the URL /contact/app-suggestions fails and reverts to /contact.

CommentFileSizeAuthor
#11 cf_spaces.jpg19.57 KBbehindthepage
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

behindthepage’s picture

That is correct. You can't put hyphens in category names.

Regards
Geoff

mototribe’s picture

Category: bug » feature

I ran into this problem too.
The category name is shown in the dropdown menu of the main form and if your category name has multiple words you have to use spaces.
That will cause the URL to contain spaces. Most browsers should be fine with spaces in URLs and if they don't it should revert to the main contact form.

Otherwise it would be nice to use a "machine_name" that is generated from the category name.

Great module, btw. I use a contact form as my default 404 error page.

behindthepage’s picture

Hi Mototribe,

This has been an issue ever since writting the module and I have finallly worked out a solution that will keep everyone happy and cater for the legacy code.

What do you think of having some radios on the setting page with the following choices?

  • Dont replace spaces in url
  • Replace spaces with hyphens
  • Replace spaces with underscores

Another ongoing issue has been the redirection. I have had people say it should go to 404 so I could have another option

If Contact Form not found go to

  • 404 page
  • This page ............

What do you reckon?

Regards
Geoff

mototribe’s picture

Hi Geoff,
that would certainly work. In terms of user interface I've come to like the D7 way of using a "display name" and a "machine name".
Views module works that way and it's intuitive.

If a contact form isn't found I would do a 404. That's how other modules work too. Also, if you have a broken link to a specific
contact form and redirect to the main contact form you'll have users complete the task. However, the experience isn't optimal and you might
never find out that you have an incorrect link on your site.

Just my 2 cents ;-)

All the best,
UWE

mototribe’s picture

btw, just came across this module http://drupal.org/project/machine_name, might be useful for generating a machine name if you go down that road.

behindthepage’s picture

Thanks for your 2 cents worth although I think it is probably worth than that.

I will implement those features although probably not until Christmas/New Year break. I mean what else is there to do on New Years Eve?

The display name and machine name issue is handled by the core contact module which I just extend so I probably won't be able to do anything with that but I think the changes we have discussed will solve the main problems that people have been having.

Thanks
Geoff

mototribe’s picture

excellent, glad I could help!
Better not ask me for ideas on what to do on New Years Eve, otherwise you'll never have time to make the changes ;-)

all the best,
UWE

DeNelo’s picture

Another issue related to this is internationalization:
If my category has extended characters in it, for instance "Løvens Land - Børnekirken" or "Økonomi" -then the category gets stripped away from the URL and I wind up at the plain contact page.

behindthepage’s picture

Hi DeNelo,

This comment would have been better as a new issue but I have released V 7.x-1.4 which supports Internationalisation and may solve your problem. Please check it out and start a new issue if you still have the problem.

Regards
Geoff

generalelektrix’s picture

Just installed 1.16 for Drupal 6 today and, while testing, found out that I forgot this problem.

Of course, one solves it by simply changing line 23 this way:

//$category = str_replace(array('-', '_') , ' ' , arg(1));
$category = str_replace(array('_') , ' ' , arg(1));

But, then hyphens are common in french in person names. Example: Jo-Anne, Marie-Josée, etc. Since most of the contact forms we created are used to contact staff in our team, it's a problem here and I will always have to remember this hack when I update the module until this case is resolved.

Thank you!

behindthepage’s picture

Assigned: Unassigned » behindthepage
FileSize
19.57 KB

Hi GE,

I am working on this at the moment. Please see the image attached which is the form element that I have added to the Contact Forms settings page and give me your opinion on the wording. I would like to make it as clear as possible as it can be a bit confusing and need a second opinion.

Regards
Geoff

generalelektrix’s picture

Looks great! Clear and simple. I will choose options 3 for sure. Don't replace spaces. Or replace them with %20? That's what browsers do with them in http requests and responses anyway.

behindthepage’s picture

Released 6.17 with this feature added.
Ver 7 coming soon
Regards
Geoff

generalelektrix’s picture

Thank you very much behindthepage!

I will try it and let you know the result.

behindthepage’s picture

Status: Active » Closed (fixed)