Here's a list of notes I took in the Prague presentation prep we did on Friday with Alex and Jess. These are not necessarily things we should do, but things we could discuss as they are all things that stood out to me.
TODO: Get rid of getFormID(): #2089593: Have FormBase auto-generate form IDs, so you don't need to implement getFormID() on all forms
TODO: Move SystemConfigFormBase to Form namespace: #2089627: Move \Drupal\system\SystemConfigFormBase to \Drupal\Core\Form\ConfigFormBase
TODO: Change pattern => path #2051097: Change "pattern" to "path" in *.routing.yml files
TODO: Add a config() method to SystemConfigFormbase so you don't have to see horrible awful HORRIBLE stuff like $this->configFactory #2087279: Add a config() method to FormBase
TODO: How do translate field settings (e.g. "On" and "Off") in CMI files
TODO: Options field allowed_values should be type: text not type: string
TODO: Drop IdentifiableInterface :P just put id() in EntityInterface
TODO: Fix docs in api.php to typehint properly (e.g. UserInterface)
TODO: \Drupal:: everywhere #2053489: Standardize on \Drupal throughout core
TODO: Find DIC tetst issue from alexpott?
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | installererror.png | 101.81 KB | Cyclodex |
Comments
Comment #1
webchick.
Comment #1.0
webchickUpdated issue summary.
Comment #2
webchickAs an update, we nailed the following easy things tonight:
#2089627: Move \Drupal\system\SystemConfigFormBase to \Drupal\Core\Form\ConfigFormBase
#2087279: Add a config() method to FormBase
#2051097: Change "pattern" to "path" in *.routing.yml files
#2053489: Standardize on \Drupal throughout core
#1614186: Coding standards for using "native" PHP classes like stdClass in namespaced code
Still in the process of writing up some of the issues, but got a tentative +1 for IdentiyInterface from fubhy in IRC, so that's a start! :)
Comment #3
webchickRe-purposing this issue for our DrupalCon Lab.
Comment #4
webchickComing from #1969572: Make Uuid a service, a few more things stood out over there:
a) We really, really need to make some firm guidelines on when to use Drupal->service('uuid') and when to do Drupal->uuid(). Something simple like "If it's used from more than two places" or whatever would work for me. I know there's another issue to discuss this, I'll try and find it and cross-link it in the summary.
b) Why sometimes event "underscore" dispatcher and sometimes config "dot" factory? We should standardize on service names like we do on router names. There's also a separate issue for that.
A few things here:
c) "configFactory" seems like leaky abstraction to me. Why do I care if you implemented config as a Factory pattern or a Singleton pattern? I care about needing config in my class.
d) Similarly, I'd make uuidService just "uuid."
e) Less sure about "entityManager" but seems like it might be the same thing?
Comment #5
Eronarn commentedWorst DX issue I ran into thus far: form array keys with periods getting eaten and not showing up in $form_state['values'], so instead having to assign period-containing config entries based on the not-period-containing array keys. (And because you don't get nested keys from $form_state['values'], you can't do something like concatenating ['values']['foo']['bar'] into 'foo.bar' in a loop.) This is error-prone, particularly if anyone needs to change that form later, and the DX for making a mistake sucks (you pull out a null value and set that, or you pull out the right value but set it in the wrong key). Some kind of helper or other magic would really help speed up construction of the most common kinds of forms.
Also, if I want to define an admin config form properly, I need to touch foo.routing.yml, foo_menu, foo_admin_path, and then still define the form ID in the form class. Yikes!
Comment #6
lorique commentedI ran into an interesting problem
I was trying to clear my config cache, because a config file wasn't showing up. So in order to force it, i deleted my files/config-xxxwhatever folder and i got a fatal error saying something to the effect of "cant find directory"
I was unable to trigger a rebuild on these settings, and we should probably find a way to do this. If the settings files are just cache, we should be able to regenerate these files, if not i say we should have the settings in a cache somewhere in the DB as well. This could, potentially, also help during development because you would be able to bypass the cache.. like the d7 rebuild theme on page load thing.
Comment #7
aspilicious commentedThe config direcotry is NOT a cache... It contains all the config and a cache clear uses THIS directory to FILL the cache :).
So yeah you should never delete those files, ever...
Comment #8
Eronarn commentedI managed to do something similar by using the GUI configuration sync tool when I had only one module's configuration file in the staging directory, not realizing that a missing file indicates 'delete'.
Comment #9
Cyclodex commentedHere the D8 installation issue I ran into - discussed quickly with webchick:
Starting issue:
My MAMP was not up2date and so I got the message, that my PHP Version is not Supported - so I downloaded the latest and installed it. Fine!
Installing D8

Without changing anything I downloaded D8 and wanted to install it... Everything fine until the modules are enabled/installed, there I got the following message, which hopefully should lead me to the error message or hint what was going wrong, but no success... (just Internal Server Error)
There is also a link "Please continue to the error page" - which was just a blank page then...
I had to check my error log, which told me about the memory issue!
Sure the standard memory configured was way to low for Drupal8, but could we not provide the information, or even pre-check if enough memory limit is avilable.
More advanced:
Perhaps warn depending on the profile you install ? - because the minimal profile worked fine!
At least we should try to help better with the message, don't you think?
Comment #10
Eronarn commented@Cyclodex Fortuitous - I forgot that I had something similar occur several times, except in my case it was due to a 30 second PHP execution limit. Also, in my case hitting 'continue to the error page' just brought me to the next installation step with no indication of whether any configuration had actually failed to complete.
Comment #11
mmilano commentedHere's a DX issue based on a recent challenge of figuring out the proper way to add a non-base field to a module that provides a custom entity.
#2107645: Adding non-base fields to entities
Comment #12
blackra commentedI promised webchick that I would give some feedback from the BADCamp 2013 Drupal 8 module session on 26th October.
I did look to see whether I could find it in any of the documentation I "should have read". Unless it is on display in a locked filing cabinet in a disused lavatory...
Comment #12.0
blackra commentedadded FormBase::config()
Comment #13
clemens.tolboomChange record entity_get_info() deprecated. Use \Drupal::entityManager()->getDefinitions() it is not possible to get to the data-set a ConfigEntityType has.
Thus added child page #2304863: EntityType should support toArray()
As this meta issue is referred from https://www.drupal.org/community-initiatives/drupal-core/d8dx as the place to be I wonder why we have way more open DX issues in the queue.
Is this issue still actively monitored? How can I help?
Comment #20
berdirFeel free to re-open, but there hasn't been any comments here since 2013 and many things from the issue summary have been addressed and others are likely not possible due to BC. Just create new issues if you want to improve something.