Announcement

  •  » Engine
  •  » Share Album, feedback on code

#1 2021-10-07 10:24:55

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13791

Share Album, feedback on code

Hi petitssuisses,

I'm reviewing the code of [extension by petitssuisses] Share Album and I have some questions/feedbacks.

* Uninstall

Instead of performing deletes in tables user_access + user_infos + users (without using the configurable column names), you'd better use the delete_user function : much more reliable/complete and providing a trigger for other plugins.

Same for groups with delete_groups function.

* Install

You have 2 different codes for methods "install" and "update" in your ShareAlbum_maintain class. I do prefer doing, like in Community, something like:

Code:

  function update($old_version, $new_version, &$errors=array())
  {
    $this->install($new_version, $errors);
  }

and in the "install" method you check the existence of such table/column before adding it. Both ways work, but I like the one I use on Community better. It avoids code duplication.

Offline

 

#2 2021-10-11 08:51:55

petitssuisses
Member
France
2013-05-03
36

Re: Share Album, feedback on code

Hi,
Thanks for the suggestions, they completely make sense.
Code is being updated, will be released in 12.2
Cheers

Offline

 

#3 2021-11-24 10:46:00

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13791

Re: Share Album, feedback on code

Hi,

Seems fine BUT I have encountered a problem. I had to manually ask for a purge of compiled templates in order to see the new version of the configuration page. I don't understand why yet.

Offline

 
  •  » Engine
  •  » Share Album, feedback on code

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact