On Wed, Jan 30, 2019 at 6:04 PM Guillaume Delhumeau <
guillaume.delhumeau(a)xwiki.com> wrote:
Why can't we introduce an "Update
objects" field, but only when the page
actually hold an XClass? It's not the main use-case. It's even quite rare a
end-user rename such a page. That would not complicate the UI that much 99%
of the times.
Renaming directly a page that defines a class might be rare but renaming a
page that has a child page that defines a class is definitely not rare. So
you're suggesting to always update the objects when renaming the parent of
a class (with "Preserve child pages" on) but to allow the (advanced) users
to decide not to update the objects when renaming directly the class? Or
are you suggesting to use the "Update links" option when renaming the
parent of a class and the "Update objects" option when renaming directly
the class? I find both ways too complicated.
A warning could also be displayed, saying that it might break some
application (even when updating the XObjects, because the Velocity scripts
are not magically updated as well).
Le mer. 30 janv. 2019 à 16:55, Simon Urli <simon.urli(a)xwiki.com> a écrit :
Hi Marius,
On 30/01/2019 15:45, Marius Dumitru Florea wrote:
page
> rename job (from refactoring module) to update the existing objects
when
a
> class is renamed *if the "Update links" options is checked*.
>
> Of course, we could add a new option (e.g. "Update objects") but:
>
> * it complicates the rename UI (too many options)
> * I think most of the users understand the current "Update links"
option
as
"update the places where this page is
*used*". I don't think it makes
sense
to have separate options (at least at the UI
level) for things like
"Update
macro calls" or "Update image
includes".
* I don't see why you would want to update the back-links but not the
objects (or the other way around).
I agree that the UI for final users should remain simple. Now on a dev
user point of view maybe it might worth it to distinguish the two
options in the RenameRequest.
If we agree on using a single option
("Update links") then the next
questions are:
* Is there a better name? I think "Update links" is a good name for
simple
users so I would keep it. Another option is
"Update references" but it
has
a special meaning for XWiki developers.
* Should we update the hint for the "Update links" option? I think we
should, but only for advanced users, since they should be aware of the
implications of renaming a class. Simple users are not aware of the
existence of objects, most probably, so I wouldn't complicate their
lives.
The final question is whether we should keep the rename job question
about
> classes. I think we should. The reason we added it is because renaming
a
> class is currently dangerous. Updating the
objects makes it a bit less
> dangerous because the data is preserved, but classes are often used in
> scripts (e.g. a live table) and those scripts are not updated so
there's
a
high chance that something will not work
correctly after the class
rename.
WDYT?
I agree that the question should remain if we cannot guarantee that all
mentions of the classes are not renamed.
Simon
Thanks,
Marius
--
Simon Urli
Software Engineer at XWiki SAS
simon.urli(a)xwiki.com
More about us at
http://www.xwiki.com
--
Guillaume Delhumeau (guillaume.delhumeau(a)xwiki.com)
Research & Development Engineer at XWiki SAS
Committer on the
XWiki.org project