Skip to content
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

"Back to X" button should use GridField title, not name #43

Open
kinglozzer opened this issue Jan 29, 2020 · 3 comments
Open

"Back to X" button should use GridField title, not name #43

kinglozzer opened this issue Jan 29, 2020 · 3 comments

Comments

@kinglozzer
Copy link
Member

https://github.com/silverstripe/silverstripe-gridfieldqueuedexport/blob/2.3.0/src/Forms/GridFieldQueuedExportButton.php#L193

The title ($gridField->Title()) is more likely to be human-readable than the name - e.g. ModelAdmin generates a sanitised version of the FQCN of the DataObject.

@emteknetnz
Copy link
Member

emteknetnz commented Jan 31, 2020

@kinglozzer
GridField::title is currently a protected field, if we also added public GridField->getTitle(), remembering that title may be blank, would something like this work:
'GridName' => $gridField->getTitle() ?: $gridField->getName()
?

@kinglozzer
Copy link
Member Author

GridField should inherit FormField::Title() (dunno why it’s not called getTitle()!) so we do already have a method for it, I think your suggestion of falling back to getName() sounds good 👍

@NightJar
Copy link
Contributor

NightJar commented Feb 2, 2020

I believe the reason for being Title() and not getTitle() is for indicating use by, or some kind of limitation of, the view layer. Could just be a legacy thing too. 🤷‍♂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants