I git your point before, but anyhow: we should probably at least list all reserved word (aka Page method names) on that Panel error page. Should I try to come up with a pull request that adds this?
P.S. The issue above is not the same; even if you can use that PHP code to at least access data stored in fields using a reserved word as name, you still can’t edit such a page as a whole in Panel at all.
I know, the problem I quoted only existed when you tried to access the field in your templates, and not already in the panel. However, catching the error right in the panel before it can even make it to the templates, seems to make sense, don’t you think?
Edit: Of course, this problem will make updating a site more troublesome.
I think the current way things work in the panel is alright. Adding a complete list of reserved words might make sense.
Would it make sense to trigger a notice every time a field with a reserved name gets accessed in a template, reminding the developer to change the name to avoid future problems?
@texnixe: That would not help either; even the cheat sheets does not list all Page method names. I rather have a automatically generated list of reserved words in Panel itself then relying on (mostly outdated) documentation.
It’s not a problem, it’s just a question of preference. And I would prefer a separate list I can refer to in the docs rather than a screenful of words in an error message.
Maybe your idea is just way better. I haven’t checked out how panel translations work and whether there are fallbacks for missing languages like in the core? If there are not, maintaining the same list for each of the 10+ languages is a unnecessary complication (and hard-coding the list in the template file seems weird as well).
In that case I would agree with a link to the cheatsheet, if only for practical reasons.
@texnixe: As far as I read the change log carefully enough this new restrictions was not even mentioned there, which definitely should have happened, as it might break hundreds of Kirby instances out there.
They will break again, as soon as someone comes up with a new page method and forgets to update the documentation.
Documentation is a nice add-on, but IMHO not good practice for a list of reserved words that might change easily over time.
I think, I got your concerns now. They are irrelevant because these reserved words are due to naming of methods in Kirby core, reads, all English only. (At least as no one decides to come up with German Page method names in PHP.)
Last but not least: I proposed to automatically generate that list at run time from all Page methods available, i.e. to not hard code them in the documentation as proposed by @texnixe.
I guess it will be impossible for the panel to conclude the list of reserved words just from the PHP code. So there would still have to be a list of reserved words. I don’t know how the panel produces its messages, but I guess that they are all stored in translation files. In that case you would have to maintain the same list of reserved words in each translation file in order to display helpful messages.