Is there a way this module could provide default machine names for blocks? It is a hassle to have to go in and add machine names each time this module is enabled.

Comments

pfrenssen’s picture

We could provide UUIDs by default. Those are not pretty, but they are unique, which is a requirement to avoid clashes between different exports.

DarrellDuane’s picture

I agree that UUIDs are messy.

Would it be cleaner to go through and attempt to generate a default machine name, and test this machine name
against all existing machine names, and then add a _0, or _1, etc to the end of the machine name if it wasn't unique until a unique name was found?

I may write a patch if this strategy sounds OK.

pfrenssen’s picture

No that won't work. Say you create a feature on site A which has a nodeblock, this would get ID nodeblock_0. Then on site B you create another feature with a nodeblock which gets the same ID. If you then later on want to create a new site C which reuses both features you have a machine name collision. They really need to be completely unique, and UUIDs are a good solution for that.

Mind that the scenario above is the original use case for the Features module and we should honor that. The current popular use case of storing configuration in code to facilitate deployment is just a very convenient side effect.