Blogs: Add Personal comment in OuBlog

Blogs: Add Personal comment in OuBlog

by Павел Цытович -
Number of replies: 16
Hi!

Please help me. I want to use OuBlog for personal blog for me and for my student. But other user have no right (access denided) to create comment to my post in my personal blog. What should I change in code editcomment.php?
Average of ratings: -
In reply to Павел Цытович

Re: Blogs: Add Personal comment in OuBlog

by Jamie Robe -
Hi. I just asked the same question in another really long thread in this forum. I hope it is an easy fix. I am having the same issue.
Jamie

In reply to Jamie Robe

Re: Blogs: Add Personal comment in OuBlog

by sam marshall -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
I filed this as CONTRIB-988 and have now fixed it. Amusingly, the same bug applies to our system, and it was reported to me exactly while I was reading this forum post! Literally, somebody came up to me at my desk then.

The fix is in CVS now (only editcomment.php changed, however you should update the entire oublog folder to ensure that you have current versions of other files that changed about a week ago), or you can wait 24 hours from now when the updated zip file will be available at the standard Moodle plugins download page.

Even though there are no database changes, I updated oublog/version.php so that you can tell you have the fixed version - it is now 2009012200.

After you've updated your system, please check it works, and continue to report any bugs (you can post here or preferably use the Moodle Tracker). Unfortunately it looks like our technical testing process didn't properly cover oublog so there might be other bugs. We'll probably find them here too, but...

--sam



Average of ratings: Useful (1)
In reply to sam marshall

Re: Blogs: Add Personal comment in OuBlog

by Jamie Robe -
Thank you Sam for the quick response. I guess that was a case of synchronicity smile

What is the link to the CVS? I have some time this am that I can download the fix and test it out. Will report back to you how it works, etc.

Thanks again for working on this great blog system,
Jamie

In reply to Jamie Robe

Re: Blogs: Add Personal comment in OuBlog

by sam marshall -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
The server is cvs.moodle.org but I don't know whether that gives you web access, I always use it via the client in my developer environment.
In reply to sam marshall

Re: Blogs: Add Personal comment in OuBlog

by Jamie Robe -
Hi Sam,
Thanks... another synchronicity, as I just hunted around moodle posts and figured out the path. Got the files, uploaded it, the update notification was good, and now it seems to work fine.

A bit of advice if you have a minute. I want only teachers on teh site to be able to have "personal" blogs. My understanding is that those are the ones that show up when you add a blog to the front page (that is a classroom itself on moodle) - is that correct?

I have been changing the global permissions on the oublog by roles, so that guests only view them, everyone else can comment, and teachers can do everything. I notive when logged in as a test authenticated user, I do still see my user's blog name (created earlier) in the little box on the top right of the blog, as a link. When I click, he of course has no editing rights and there are entries, but will everyone still have one by default? Should I just hide the link to it?

OR, should I make a classroom just for teacher blogs, like in the teacher's lounge room I have set up?

Anyway, thanks again. I will report anything I find in terms of bugs, etc.
Jamie


In reply to Jamie Robe

Re: Blogs: Add Personal comment in OuBlog

by sam marshall -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Hi,

I didn't quite understand the problem you're trying to report, but there's one part in what you're doing that I don't think will work if you have the standard role setup. Personal blogs are at the site level. That means only site roles and permissions have any effect on personal blogs. Usually the teacher role is only within a specific course, so it won't do anything at site level. You would have to give all your teachers some kind of role (e.g. make a new one called 'blog user') at the system level in order for this to work.

One other possibility would be to add a blog to each course - just override the permissions so that Student can't post (or change that in the default role settings if you want it the same way everywhere). That way the teacher(s) on the course can blog there, and students on the course can comment. Or if you change the visibility setting to 'world', and use that for each post, then everyone can see it - provided you give them a link somewhere - and everyone with a login can comment.

Hope this helps although as I didn't really understand, maybe it won't!

--sam


Average of ratings: Useful (1)
In reply to sam marshall

Re: Blogs: Add Personal comment in OuBlog

by Jamie Robe -
Thanks again Sam. I am going to need to code a block that pulls in the latest oublog entry for any specified blog, probably only room for a shortened teaser part of the entry. My thinking is to have a column on teh homepage with featured teachers blogging. The reason I am telling you my plans, is I want to make whatever I code available back to you, if that is useful. I also haven't started, and if you have heard of anyone who has done this, please let me know. I don't want to reinvent the wheel, but I think this would be a useful function to have for both inside a class, as well as on the my moodle page or even front page.

Your answer actually helped me, as I didn't quite get that the personal blogs are at the site level. What is the difference between the permissions for the top two items? View posts vs view posts in personal blogs...
It is still not clear to me when I click one or the other to get different effects.

Jamie


Attachment authenticateduser.png
In reply to Jamie Robe

Various oublog bugs

by sam marshall -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Unfortunately I just found and fixed a number of bugs, not only the one about displaying the wrong blog name when you post a comment. smile

Jenny Gray and I have just finished reviewing the fixes we're about to put in place as CONTRIB-998. We think they are okay - probably.

Jenny's also going to try and get our technical testing people to have a thorough check of the system as part of its deployment on the OpenLearn platform. Clearly the testing on oublog to date hasn't been acceptable. If you're relying on oublog for critical work, you may prefer to wait a month until our testing is complete. Then again, although I didn't specifically identify any, these fixes may help with some security issues, so...

As usual, the fix is in CVS now, however you will need to wait 24 hours if you want to re-download the zip. New version is 2009012600.


As part of this fix there's a change to the capabilities which I think should address the issues mentioned in this thread. The change is that we don't use the mod/oublog:comment and :post permissions for personal blogs any more (I don't know how on earth those worked, if they ever did*). We've replaced both with mod/oublog:contributepersonal (to go alongside the existing mod/oublog:viewpersonal).

so in other words when you post to a blog...

1) if it is a course blog, you need mod/oublog:post permission on the context of that blog (usually the course).

2) if it is a personal blog, you need mod/oublog:contributepersonal at the system level

The upgrade alters your existing roles to get rid of :post (and :comment if present) on the 'authenticated user' role, and adds the new :contributepersonal on that role. So you should find that you don't have to do anything. But if you've been trying to configure the roles in a more detailed manner you will probably need to change it after updating oublog to the 2009012600 version.

The reason for the different capabilities for personal and course blogs is that you generally need them in a different place. The personal ones are needed (usually by the 'authenticated user' role) at system level. The course ones are needed (usually by the 'student' role) at course or module level. Using these capabilities, you can grant or refuse access to personal blogs, and course blogs, independently. Before this it was incomprehensible (even if it worked, which I don't think it did).

--sam

* This is largely my fault, not the developer we originally outsourced to, as I think I specified it to share the same caps for both originally. I also think I specified a clever technique for making it work but, um, maybe it wasn't as clever as all that...



Average of ratings: Useful (1)
In reply to sam marshall

Re: Various oublog bugs

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Sam, I don't know what I am talking about, but I was just wondering whether it would be better to change it to check mod/oublog:contributepersonal at the user level. Most of the time that will lead to exactly the same result, but it would give a bit more flexibility.

For example you could turn off personal blogs for all users, but then use a role override to turn it back on for certain users. (I have to say, that in this case, a 'Personal blogger' role would be a better solution, becuase it makes it clearer what is going on.

A better example is that if you had a Parent role defined, you could possibly allow parents to add the their child's blogs.
In reply to Tim Hunt

Re: Various oublog bugs

by sam marshall -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
I think you are correct (unless there is something I'm missing). Before we started tidying this up there was some code that sort of halfheartedly used user contexts in some places, but it didn't work.

I'm not changing it any more right now smile but at some point we should indeed probably change it to use user contexts. Hopefully since I made the new 'check permission' functions, it will be easy to change globally (although probably not, as there are a number of other checks for the less common permissions that aren't in functions yet).

--sam
In reply to sam marshall

Re: Various oublog bugs

by Jamie Robe -
Hi Sam,
I downloaded the new version and installed. All went fine.

The problem of any user Jane seeing her personal blog in the path when commenting on someone else's is now gone - thanks.

However, I see an issue that has now come in that is going to cause me problems at the system level, anyway. Perhaps I am missing how to do this again, like I cold in the previous version.

You basically now have the System permissions - view post and a second one that now lets you post AND comment. That is my problem. I want authenticated users to be able to obviously view, but I only want them to be able to comment.

Under the original OUBlog heading, you have the settings for the oublogs in a classrooom with the posting and commenting split out.

Can I just add an oublog to the frontpage classroom, and then use only the OUBlog settings and set the System (personal) settings to deny to get this effect? I am confused again wink

Jamie

Attachment new_oublog_system.png
In reply to Jamie Robe

Re: Various oublog bugs

by Jamie Robe -
OK, some further testing to report here Sam.

I can create a oublog on the frontpage or in any classroom, and i can control who can view, post, and comment aok.

I did notice an error in both scenarious: There is a hyperlink in teh first right hand box that says "blog Options", showing up only for those authorized to ad posts, etc. When you click it, it comes up with "Instance parameter is incorrect" witha continue button.

That shows up that way for both frontpage and classroom oublogs.



I guess for now I will shy away from the personal oublogs till all the dust settles. Let me know if I can help in anyway by testing, etc. I want to help make this work.
Keep up the good work,
Jamie

In reply to Jamie Robe

Re: Various oublog bugs

by sam marshall -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Sorry, as per other post I have been really busy and this got left behind in my inbox. sad

1) So you want separate 'post' and 'comment' capabilities for personal blogs... argh. sad Reluctantly I agree, our attempt to combine them was probably a bad idea. I'll split them apart again, but I'm not sure when I'll get a chance to do this as our development schedule here is looking pretty heavy.

If you could post a Moodle tracker entry officially requesting that we split out that capability into two, postpersonal and commentpersonal, please do. (And if you feel like coding a patch yourself and posting it in the tracker entry, that might help matters along, of course... remember to correctly handle upgrade from systems that use contributepersonal, if you do that. It's probably a bit complicated to get right and there's not much benefit doing a partial job so I'll understand if you leave it to us!)

2) You should be able to add an oublog to the frontpage classroom, and then use roles (in some way) to allow only certain people to post/comment, and then basically prevent use of personal blogs via those settings, yes. Don't know if this works.

--sam


In reply to sam marshall

Re: Blogs: Add Personal comment in OuBlog

by Павел Цытович -
Thanks for problem solving, but I have found two problems. First problem, I login in my user and add comment to administrator (other user) blog. I see in header of create comment page my blog name, but I work with administrator blog. Comment create successfully to administrator blog, but user can deside that comment add to his blog.

The Second problem occurs when user haven`t personal blog and attempts to add comment to other user blog: "blog not instance" mistake takes place
In reply to Павел Цытович

Re: Blogs: Add Personal comment in OuBlog

by Jamie Robe -
Hi, is it Naben? Anyway, as you can see form the earlier posts, I am but a humble new user of oublog, but I was looking at what you just posted.

1. I think your first problem is similar to what I am doing. I have a personal (as Sam pointed out those are at the site level) blog for the administrator. I want other users to be able to read the posts and comment, but not have their own oublogs. I just turned off the permission at the administartors panel -
  • Administration
  • / Users
  • / Permissions
  • / Define role
Attachment blog_path_shows_users_blog.png
In reply to Павел Цытович

Re: Blogs: Add Personal comment in OuBlog

by sam marshall -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Thanks for this. I think you have probably identified an additional bug. I'm too busy today to respond to this as we have a code freeze today, but will look at this - and the other posts - next week, and post a proper reply then.

--sam