Skip to Content Skip to Menu

Solved/CB GroupJive Gallery : DB Issue after changing author of a media in album

  • Toulouzing
  • Toulouzing
  • ONLINE
  • Posts: 215
  • Thanks: 22
  • Karma: 2
2 days 21 hours ago #344006 by Toulouzing
Hi !

Today I had a mess with an album photo in a group. The album is supposed to be fed by members of the group but for many reasons, it can be fed by the group owner or superadmin 'on behalf of' .... In order to link the photo with it's owner, I wanted to manually change the owner ID of each photo in backend ( plugin CB Gallery>Media>Owner) guessing it was a simple update of the database...

Unfortunatly this operation messed up the album :
- Changing the owner ID unlink the photo to the album ID ( this can be fixed in PHPMyadmin in table xxx_comprofiler_plugin_gallery_items)
- Loose the photo attached - not anymore visible in frontend as well as in backend ( in media folder comprofiler)

So I had to upload again each photo to recreate the album...

My question is : is there an explanation to this behavior (bug or not) and is there a way to makes this kind of operation easier ?

Thank you

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 50476
  • Thanks: 8637
  • Karma: 1472
2 days 1 hour ago #344013 by krileon
Changing the album owner will move the original owner media into the new owners user id. So if the album has an owner of 100 and 3 photos also belonging to 100 then you change it to an owner of 200 then those 3 photos will also be changed to 200. The idea is it's a means of fully shifting ownership of the album and its contents. Will review adjusting this logic as it's probably only relevant for profile galleries and nothing else.

Beyond that nothing else happens during edit save unless Asset or Gallery where changed in which case it'll do similar logic for media within that album.

You can change Album and Media owner from backend. Frontend owner change was removed as it just caused confusion so that management will be left to backend. In backend you can do this per-album/media or use the Batch Tools to mass change the owner.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • Toulouzing
  • Toulouzing
  • ONLINE
  • Posts: 215
  • Thanks: 22
  • Karma: 2
1 day 20 hours ago #344015 by Toulouzing
Ah OK. I understand the logic because the media folder are organised with user's ID as a root . But if I understand correctly, if I change the owner (in the backend) of a photo, the link to that photo will point to the new owner's folder while the photo file itself isn't moved. That's what's causing the problem. Is that correct?
 

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 50476
  • Thanks: 8637
  • Karma: 1472
1 day 3 hours ago - 1 day 3 hours ago #344018 by krileon
Yes, that's currently a bug with that logic. I should have a fix out later today fixing it.

forge.joomlapolis.com/issues/9871


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Last edit: 1 day 3 hours ago by krileon.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 50476
  • Thanks: 8637
  • Karma: 1472
1 day 56 minutes ago #344023 by krileon
Ok, this is now fixed in latest CB Gallery build release. Changing album owner will no longer touch media owner in that album. Changing media owner will now also properly move the files.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: Toulouzing

Please Log in or Create an account to join the conversation.

  • Toulouzing
  • Toulouzing
  • ONLINE
  • Posts: 215
  • Thanks: 22
  • Karma: 2
19 hours 40 minutes ago - 8 hours 42 minutes ago #344028 by Toulouzing
Wow that's really nice ! This fix will be very useful for us because it allows administrators or moderators to upload media for helping some owners

There is one remaining issue, according to the problem i described (first topic) :

 - Changing the owner ID unlink the photo to the album ID ( this can be fixed in PHPMyadmin in table xxx_comprofiler_plugin_gallery_items)

In other words, the field folder_id is reset to 0 after changing the media owner (it should be kept at initial value)

Note: I just refer to change of media owner while media is in an album because, in our site, all photos must be in albums. 
Last edit: 8 hours 42 minutes ago by Toulouzing. Reason: changing "owner" by "media owner" to avoid confusion ( i did not try yet to change album owner)

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum