keystone-classic icon indicating copy to clipboard operation
keystone-classic copied to clipboard

Fix Create for Lists with no name and no initial fields

Open JedWatson opened this issue 10 years ago • 9 comments

At the moment if you have no name path or mapping, and no initial fields, you get an empty "create" dialog.

In this scenario, we should do one of the following:

  • Default the autocreate option to true
  • Default the nocreate option to true
  • Display a message in the "Create" dialog about the invalid List configuration

The third option is probably the safest, as there's no guarantee that items can safely be autocreated, and simply not having the create UI might be confusing for users.

Alternatively we could log a message when Keystone starts with the warning, as this is really an invalid config for a List.

JedWatson avatar Nov 19 '15 02:11 JedWatson

Alternatively we could log a message when Keystone starts with the warning, as this is really an invalid config for a List.

This would be my preference

jossmac avatar Nov 24 '15 01:11 jossmac

I vote for a 4th option of detecting this at build/run time. There's other invalid configurations that we need to detect as well.

webteckie avatar Jan 31 '16 15:01 webteckie

I vote for option 3 and display the message: 'XY has no initial fields. An empty XY with default values will be created.' I don't see this as an misconfiguration. Sometimes you just want to generate some values in a save hook and let the user fill in the rest. We could still show a warning in the log as long it is not fatal. Would you merge a pull request if I implemented this like I described?

geloescht avatar May 28 '16 09:05 geloescht

@geloescht if I came up with a use case for such configuration I wouldn't like to present users with your suggested message as it sounds a bit technically intimidating, IMO :-) I think the logging of the message at startup is the safest and non-restrictive option. Perhaps at some point we should have validation configuration for things like this.

webteckie avatar May 28 '16 09:05 webteckie

And as far as behavior, if we truly consider this invalid configuration then keystone should not come up until the issue is addressed as it happens for other invalid list configuration.

webteckie avatar May 28 '16 09:05 webteckie

And, actually personally I prefer #2201 :-)

webteckie avatar May 28 '16 09:05 webteckie

Well, me too, but let's be realistic. The initial modal is workable and killing it now would probably delay 0.4 for another month or so. If you really want to make this a misconfiguration we should still not throw a fatal error. It'd be very annoying if a server simply refused to start because of something like this. Instead, let's log a warning and set nocreate: true so everyone can see that this list is crippled.

geloescht avatar May 28 '16 09:05 geloescht

The issue I still have with this in general is whether this can be a valid configuration for some use case. Not having initial fields and not having a name field seems to me like it can be valid configuration for someone. What if you still log a message in the initial form but make it a bit less technically intimidating just in case it is perfectly intended?

webteckie avatar May 28 '16 09:05 webteckie

This should also play well if and when #2201 is addressed.

webteckie avatar May 28 '16 09:05 webteckie