-
-
Notifications
You must be signed in to change notification settings - Fork 809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix the underscore hyphen debacle #5787
Fix the underscore hyphen debacle #5787
Conversation
* @author Ross Riley <riley.ross@gmail.com> | ||
*/ | ||
|
||
namespace Bolt\Configuration; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There must be one blank line after the namespace declaration
KernelEvents::REQUEST => ['onKernelRequest', 34] | ||
]; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected 1 newline at end of file; 0 found
Just to add context for those reading along … the configuration loading/validation is being replaced in 3.3, and will address this. The problem currently is the validation & loading needs services that shouldn't be started until boot. |
* compiled and validated configuration. | ||
* @package Bolt\Configuration | ||
* @author Ross Riley <riley.ross@gmail.com> | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
G-pick … could you push that down on to of the class declaration and drop the @package
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given it is uncertain the life time of the one, could you also tag it @internal
Interim fix or not, this makes me quite happy! 👍 |
5fd78d9
to
e8c0006
Compare
As discussed in the dev-meeting: Merging in for 3.2, so we can test and bugfix before release! See https://github.com/bolt/bolt/wiki/Dev-meeting-2016-09-20 |
This fix is not working on my side : just tried to add a content type with those 2 fields :
Tried to add a new record of that type using the admin panel and got when saving :
Of course the both 'image" and 'mobile_image' was filled in the form ... |
Ok, I've tracked this down now. The bug is actually at another part of the codebase, so this PR is still ok. I'll put in another PR shortly to fix. |
OK, so this is an interim fix that's designed to workaround the existing issues with hyphens / underscores without changing too much of the code that drives config itself.
The underlying issue is that currently the main config check doesn't happen until boot, whereas most of the new storage system assumes that the config is already read and processed on register.
In reality there's probably only a small sub-set of functionality that needs to wait until boot but in the current state, nothing is processed in time.
So this PR moves config to a two stage process that hopefully gives us the functionality that we need in most use cases, at the expense of consistency between register and boot states.
Edit to add:
This also adds a soft warning when a user puts a hyphen in their contenttypes definition.
Under the hood it is translated to an underscore, but with the warning that they should update.