![]() ![]() Let’s imagine we have a radio button field that originally had three available options (“red”, “blue”, “green”), but now our client wants the field to have only two options (“red”, “blue”). Instead, one potentially straightforward way for us to update our field storage settings is via Drupal’s Update API. Or, even worse, you could decide to maintain both fields as a way to “archive” the old data, in which case you add another layer of confusing technical debt to your site and now you have to find a way to prevent users from entering data in the old field. However, that would then require you to plan a migration of all of the existing data from the old field into the new one. You might be tempted to avoid the hassle and create an entirely new field that duplicates the functionality of the old one. In our case, options on a checkbox/radio button field are considered field storage. For example, if you try to alter the storage settings of a field that already has corresponding data in the database, Drupal will alert you that this is not allowed via the UI. But what about when you’ve already launched your site? Or, even worse, if the site has already been live for weeks, months, or years? Presumably, you have data already populated in every possible field on your production site.Īt that point, even the simple case of modifying the available options in a checkbox/radio button field can become an unexpectedly difficult task. For example, if a brand new site is still unpopulated with actual data/content, we can update entity fields and their settings without much regard to anything. This type of scope creep, large or small, can be manageable in specific circumstances. ![]() Other times, a client might simply need to modify the available options in a checkbox or radio button field. Sometimes, a large portion of a site’s data architecture may need to be reconsidered via a design change. However, despite clients’ and developers’ best intentions, the data requirements of any given project can often change at any time. This is important as both new and existing Drupal sites require careful planning of how their content is structured, usually in the form of setting up content types and fields. As some of its biggest strengths as a first-in-class Content Management System, Drupal 8’s Entity API and Field API provide for both the creation and maintenance of powerful, structured data architectures with relative ease. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |