Skip to main content
7 events
when toggle format what by license comment
Apr 4, 2017 at 17:42 comment added Adrian Cid Almaguer Thanks, I'll made some test and I'll let you know the result, for the moment I use the code in the question and this query to know the content types that don't have nodes SELECT type FROM {node} GROUP BY type The difference between all the content types defined and the content types that have nodes are the content types that don't have nodes.
Apr 4, 2017 at 17:36 comment added Berdir Yes, such a join isn't really possible anymore but there are some alternatives. you could do an entity aggregated query and then compare that against a list of node type ids. Or if you don't have dozens of types, it might actually not be that much slower to just loop over the types and select one record, because a count(*) on a large data sate can be quite slow if it's not well optimized.
Apr 4, 2017 at 15:06 comment added Adrian Cid Almaguer Yes, I just don't explain my point, In Drupal 7 with this query SELECT type, name, COUNT(nid) as total FROM node_type LEFT JOIN node USING(type) GROUP BY type HAVING total < 1 ORDER BY name I can get all the content types that don't have nodes, but now this is not posible because I can use the LEFT JOIN with the config table. This is my point.
Apr 4, 2017 at 14:11 comment added Berdir machine names are the ids, what exactly do you need to join/query?
Apr 4, 2017 at 13:27 vote accept Adrian Cid Almaguer
Apr 4, 2017 at 12:53 comment added Adrian Cid Almaguer thanks, and for the moment there is no way to involve a LEFT JOIN with the content types machine names and other table?
Apr 4, 2017 at 12:48 history answered Berdir CC BY-SA 3.0