Creating a new content type without touching the location options causes the form to be rejected throwing this error:

You can't show more empty location forms than the maximum number of locations allowed for this content type.

Frankly, this doesn't make sense anyway if the maximum is set to zero.

Furthermore, this error makes it impossible to import any content types that don't define location options (hence the critical status).

Comments

seanr’s picture

FYI, the field referenced by the error is location_settings[multiple][add] which has a default value of 3.

garbanzito’s picture

this validation glitch also occurs for actions such as deleting a content type whose maximum is set to zero; deletes probably shouldn't try to validate form values in the first place

aterchin’s picture

Yes, I agree this is a big one. Had to disable location module in order to do any exporting/importing of content types.

mlncn’s picture

Status: Active » Needs review
StatusFileSize
new669 bytes

Not the ideal fix, but a fix nonetheless. Rather than changing the validation (which I agree is overzealous) this patch changes so the empty location forms default is also zero, not three.

seanr’s picture

I think I had tried setting it to zero and it still didn't work even then.

mlncn’s picture

This patch is working for us, including for importing content types.

socialnicheguru’s picture

subscribing... thanks

aterchin’s picture

Works for adding, importing, and exporting for me too.

mlncn’s picture

Status: Needs review » Reviewed & tested by the community

In that case... ready to be committed.

bdragon’s picture

Status: Reviewed & tested by the community » Fixed

Fixed in DRUPAL-5--3, DRUPAL-6--3, and HEAD.

The check itself was faulty, with max 0 it shouldn't even care what add is.

http://drupal.org/cvs?commit=163185
http://drupal.org/cvs?commit=163186
http://drupal.org/cvs?commit=163187

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

kristen pol’s picture

For version 3.0, if you don't want to use the dev version, see http://drupal.org/node/376228#comment-1309960 for patch.

bdragon’s picture

Title: Default location settings for new content type are invalid » [master] Default location settings for new content type are invalid
Version: 5.x-3.x-dev » 6.x-3.0
Status: Closed (fixed) » Fixed

Setting to fixed again, marking master.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

bricef’s picture

When this development version will be packaged?

thebuckst0p’s picture

Status: Closed (fixed) » Active

This appears to be happening again with the latest version of Location. I'm exporting a content type with all the "# of location" fields set to 0, and when I import, it says "You can't show more empty location forms."

(and the same for creating a content type through the form, not just export/import)

thebuckst0p’s picture

StatusFileSize
new621 bytes

It seems to me that if the default is 3, the max has to be >=3, or else both should be 0. I'd prefer both be 0 myself, but the attached patch makes both 3.

yesct’s picture

Status: Active » Needs review
greggles’s picture

Status: Needs review » Needs work

3?

That seems kind of silly. Let's get them both to 1 or 0 since that is the most likely value that people really want.

thebuckst0p’s picture

StatusFileSize
new621 bytes

That works for me.
Updated the patch to set the default to 1. (Making it easy for the maintainer to commit.)

yesct’s picture

Priority: Critical » Normal
hutch’s picture

StatusFileSize
new1.28 KB

Patch in #20 broke for me, this one sets 'max' and 'at once' to 1 as suggested in #19
On current CVS DRUPAL-6--3, freshly pulled

yesct’s picture

Version: 6.x-3.0 » 6.x-3.x-dev
Status: Needs work » Needs review

code looks good to me, on visual inspection. Needs a person to apply the patch and try creating some locations (including importing, as that I think was the original issue).

kutter’s picture

I can confirm that this works in 6.x-3.x-dev.

I ran into this same problem with the 6.x-3.0 release, I installed the dev branch, and was able to import my content type, and create new nodes with location information just fine.

greggles’s picture

Status: Needs review » Reviewed & tested by the community

Seems like it's rtbc, then.

hutch’s picture

StatusFileSize
new1.36 KB

Please find patch rerolled for revision 1.222.2.37 location.module attached. The same as earlier ones but on current cvs

rooby’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.