Option to ignore empty fields

Created on 30 January 2024, 5 months ago
Updated 14 March 2024, 4 months ago

Problem/Motivation

The module ignores the 'No results' settings and so always includes fields even if they are empty.
For example, I use an multi-value entity reference field called 'Prerequisites ID' and if there are none then I don't want to see it in the output...

[
  {
    "title": "Binary terminology",
    "url": "node/60",
    "type": "Interactive challenge",
    "id": 60,
    "prerequisite_id": [
      
    ]
  },

The reasoning behind this is that strictly speaking when building semi-structed data, we should be able to have some attributes 'missing' on JSON objects.

I'm interested in comments on this.

Thank you

✨ Feature request
Status

Needs work

Version

3.0

Component

Documentation

Created by

πŸ‡¬πŸ‡§United Kingdom SirClickALot Somerset

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @SirClickALot
  • Status changed to Needs work 4 months ago
  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    I'd be more willing to implement this if you want to provide a merge request.

    I think it needs to be an option though since it would likely be a breaking change for a lot of people.

  • πŸ‡¬πŸ‡§United Kingdom SirClickALot Somerset

    Thanks @nicxvan β†’ ,
    I'm afraid I don't know how to do provide an MR, as I am a humble site-builder!

    I wholly agree that an option is a good idea.

  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    Not a problem, if you've never used Gitlab then here is a great resource to start: https://www.drupal.org/docs/develop/git/using-gitlab-to-contribute-to-dr... β†’

    For an individual project / issue click the create issue button at the top: then open it and follow the instructions to download the project in git and get the right fork.

    One trick for this project is by default you get the 2.0 branch and you need to switch to the 3.0 branch.

    If that is not enough to get started let me know and I can give more pointers when I have time.

Production build 0.69.0 2024