Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 292108

field_bundle_settings_ variable accumulates data for removed view modes

$
0
0

I create a new view mode for an entity type, either:

- by installing a module that defines one, such as diff
- in custom code with hook_entity_info()
- with a contrib module that exposes an admin UI, such as Display Suite or Custom View Modes

I then save the form at admin/structure/types/manage/article/display. The variable field_bundle_settings_node__article contains details of the view modes, like this:

Array
(
    [view_modes] => Array
        (
            [teaser] => Array
                (
                    [custom_settings] => 1
                )

            [full] => Array
                (
                    [custom_settings] =>
                )

            [rss] => Array
                (
                    [custom_settings] =>
                )

            [article_image] => Array
                (
                    [custom_settings] => 1
                )

            [diff_standard] => Array
                (
                    [custom_settings] =>
                )

        )

    [extra_fields] => Array
        (
            [form] => Array
                (
                    [title] => Array
                        (
                            [weight] => 0
                        )

                )

            [display] => Array
                (
                )

        )

)

If I later on remove my new view mode, its settings remain in this variable, and there seems to be no way of removing them (apart from hacking the {variable} table and editing the serialized array!)

Note: this is probably not relevant on D8 due to #1953528: Move 'view modes' part out of field_bundle_settings().


Viewing all articles
Browse latest Browse all 292108

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>