leap2a import deletes existing blogs

Bug #544160 reported by Penny Leach
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Low
Penny Leach

Bug Description

 affects mahara

This doesn't matter when using Leap2A to create completely new user
accounts, but it certainly matters when importing it over MNet.

The problem is that the blog plugin has the following logic:

- At the start of the import, check to see if there's already a blog for
  this user

- When importing anything, create a blog if necessary

- At the end, if a blog has been created, and there WAS a blog at the start
  of the import, delete the original blog.

This is so that if a user gets created, and they get the default "Blah
Users's blog" blog created by default, and then new blogs created, delete
the "Blah User's Blog" since it doesn't make sense.

I'm not sure of the best way to fix this - do we have *any* way to check
that a given blog is the default blog, or one that a user created
themselves?

Either way, we should certainly not delete any blogs that have posts.
Still until we figure out the above question, I don't think we can avoid
data loss :(

--
/* ---------------------------------------------------
Penny Leach | http://mjollnir.org | http://she.geek.nz
GPG: 8347 00FC B5BF 6CC0 0FC9 AB90 1875 120A A30E C22B
--------------------------------------------------- */

Tags: leap2a
Revision history for this message
Richard Mansfield (richard-mansfield) wrote :

First, there has to be exactly one blog before the import before we need to think about deleting it afterwards. If there's more than one, the user knows about multiple blogs and should be able to handle deleting it themselves.

Second, if the blog has posts, don't delete it.

Then if we want to be fancy, check if the empty blog is in a view (and don't delete it if it is), and finally whether the empty blog's mtime > atime (and don't delete it if it is).

We might want to add a way for users to move posts around between blogs (it could be handy after the import). Eventually it might be easier to give people just one blog each, and have a block that displays posts with a certain tag.

Revision history for this message
Penny Leach (mjollnir) wrote : Re: [Mahara-core] [Bug 544160] Re: leap2a import deletes existing blogs

On Mon, Mar 22, 2010 at 08:35:18PM -0000, Richard Mansfield wrote:
> First, there has to be exactly one blog before the import before we need
> to think about deleting it afterwards. If there's more than one, the
> user knows about multiple blogs and should be able to handle deleting it
> themselves.

Agree. Except the problem here is when there is exactly one before hand,
and it's NOT the default created one. For example:

- create a user account by uploading a leap2a file that contains a single
  blog. the user ends up with one blog in mahara, the one from the file (no
  default blog)

- that user then imports a bit of leap2a material over mnet. how do you
  know that the exactly one blog you had before the import started, was the
  default one, or one that was created by some other means?

> Second, if the blog has posts, don't delete it.

I implemented that already and pushed it ;)

> Then if we want to be fancy, check if the empty blog is in a view (and
> don't delete it if it is), and finally whether the empty blog's mtime >
> atime (and don't delete it if it is).

Yeah, that will help too.

> We might want to add a way for users to move posts around between blogs
> (it could be handy after the import). Eventually it might be easier to
> give people just one blog each, and have a block that displays posts with
> a certain tag.

Sure - I think that would be the ideal solution.

--
/* ---------------------------------------------------
Penny Leach | http://mjollnir.org | http://she.geek.nz
GPG: 8347 00FC B5BF 6CC0 0FC9 AB90 1875 120A A30E C22B
--------------------------------------------------- */

Revision history for this message
Evan Goldenberg (naveg) wrote :

My vote is to never delete any content automatically. In fact, maybe the right solution is to not give users an empty default blog, similar to not giving them any default portfolio views. This not only solves the question of when to delete the default blog, but also immediately makes users aware of the ability to create multiple blogs (we shouldn't have to implement logic to determine which users are aware of Mahara's features, we should just make the users aware of the features!). I actually changed the behaviour on the usability branch so that the list of blogs is always shown, even if there is only one.

That said, I agree that ultimately a single blog with proper tags is the best solution. For now, however, I'd shy away from automatically deleting things.

Revision history for this message
Richard Mansfield (richard-mansfield) wrote :

In 1.1 we started everyone with zero blogs, and always displayed the list of blogs even
if the user had only one blog. The default blog was added quite recently because
apparently having multiple blogs was a usability problem.

tags: added: leap2a
Changed in mahara:
importance: Undecided → Low
status: New → Confirmed
Changed in mahara:
status: Confirmed → Fix Committed
milestone: none → 1.3.0
assignee: nobody → Penny Leach (mjollnir)
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.