mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #16485
[Bug 1270683] Re: Don't append a number upon first copying of a page
As discussed further on in that forum thread, a number only gets
appended when a page of the same title already exists.
Well... sorta. What happens in the code is we call View::new_title()
and/or Collection::new_title(), in lib/view.php and lib/collection.php
respectively. And these run a query like this to find out if there are
any pages with "the same" title:
SELECT title FROM {view} WHERE owner=? AND title LIKE ? || '%';
The "LIKE" portion of that query means that we look for whether you have
any pages that have a title that starts with or exactly matches the
requested title. So, the requested title "Untitled" would match
"Untitled 1", "Untitled Sonata", etc. Potentially this could cause
numbers to be added unexpectedly, like if you were copying a page titled
"Air" and you had another one called "Airlines of the 1950s", then "Air"
would get turned into "Air 1".
Hm, actually, I wonder if that's what's causing the intermittent results
for the user?
--
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1270683
Title:
Don't append a number upon first copying of a page
Status in Mahara ePortfolio:
Incomplete
Bug description:
When you have turned off "Copy of..." for pages ($cfg->renamecopies =
false;), each page still gets a number appended even if that page /
collection title does not yet exist in the user's portfolio.
It would be better if a number would only be added to the title if the
exact same title already existed.
Tested on Mahara 1.8.
See https://mahara.org/interaction/forum/topic.php?id=6013
To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1270683/+subscriptions
References