Document Element::isFieldEmpty usage
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 45/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Stale
- Domain
- documentation
Research direction
Search the documentation for Element::isFieldEmpty and entry.isFieldEmpty('myField'), then review how required validation is described. Done means the docs explain that this is a valid way to check whether a field is empty regardless of fieldtype, including the usage context described in the issue.
Written by the indexing model from the issue text.
Description
Started: https://github.com/craftcms/cms/issues/5300
I would like to see isFieldEmpty (Element::isFieldEmpty, entry.isFieldEmpty('myField'), et. al.) documented as a valid way to check a field for empty regardless of the fieldtype.
It looks like Craft uses this internally for required validation, but can be useful in other contexts as well.
In my use-case, I'm mapping a set of element fields, but don't care about the actual field output data, only if it has any.
Seems like the right thing to use, but I'm wary of relying on it without anything in the docs.
- Dominant language
- JavaScript
- Stars
- 42
- Forks
- 160
- Avg merge
- 3h 9m
- Merged PRs (30d)
- 4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from craftcms/docs
-
Broken Link OpenBroken Link
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 1/5 1-3 hours Newbie friendliness 68/100
-
Broken Link OpenBroken Link
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
[Broken Link]: Open
Difficulty 1/5 Under an hour Newbie friendliness 65/100
Similar issues
-
bug confirmed issue
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
open-webui/open-webui#30750 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Mend: dependency security vulnerability untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 70/100