Quantcast
Viewing all articles
Browse latest Browse all 291721

Single bundle check in field_entity_field_info() is not safe

That function currently does this to check if an entity_type supports bundles or not:

<?php
$optional
= $bundle_name != $entity_type;
?>

There is AFAIK no such requirement, you could have an entity foo with bundles foo and bar. Then this would result in very ugly bugs.

I'm wondering if we need that check at all? Can't we just put everything in optional? That would result the complexity of that hook and also hooks that extend/alter the information in there, see #1818556-120: Convert nodes to the new Entity Field API for a bug that was caused by this complexity.


Viewing all articles
Browse latest Browse all 291721

Trending Articles



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