-
-
Notifications
You must be signed in to change notification settings - Fork 811
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed: Edge-case in title_format
for CT's with no textual fields
#7108
Conversation
bobdenotter
commented
Oct 19, 2017
$keys = array_keys($fields); | ||
|
||
return reset($keys); | ||
return array_keys($contentType['fields']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is returning all fields then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method itself returns an array of fieldnames that are considered to cobble together the title. If no suitable column is found at all, it'll either display (no title)
or something put together from fields. For example:
dummy:
name: Dummies
singular_name: Dummy
fields:
turtlesallthewaydown:
type: select
values: [ A-tuin, Donatello, Rafael, Leonardo, Michelangelo, Koopa, Squirtle ]
image:
type: image
datum:
type: date
No title
field, no title_format
and no type: text
fields. This CT would show "Donatello" or "Koopa" or the image filename in the listing overview, and "latest changes". It's not ideal, but IMHO better than before.
Before:
After:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't begin to tell you how wrong I find this approach 😢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, the change introduced in #7067 tries to return a non-existing variable … This needs tests!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, the change introduced in #7067 tries to return a non-existing variable
Yes, that is exactly what this PR is fixing: that piece of code that came from elsewehere wasn't adapted properly.
This needs tests!
When we discussed this, I thought we decided that we'd just fix it up to fix the bugs we're seeing, since it is marked "deprecated" and will get replaced sooner or later regardless.
bcdc8b5
to
306cc81
Compare
Should be GTG now. |
045c600
to
a38ad80
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️ tests ❤️