mistic100 / Piwigo-PhotoSphere

Add a Photo Sphere viewer to Piwigo
http://piwigo.org/ext/extension_view.php?eid=794
GNU General Public License v2.0
4 stars 10 forks source link

Update is_sphere with Piwigo webservices #4

Open Spettacolo83 opened 7 years ago

Spettacolo83 commented 7 years ago

Hello there! Thank you for your wonderful plugin. I'm trying to update with Piwigo webservices the value added from your plugin (in table _images, value is_sphere). I tried with the service pwg.images.setInfo but the field is_sphere is not recognized. I don't know if I have to use the service pwg.plugins.performAction, but in this case, I don't know the first parameter. They are (action, plugin, pwg_token). Can you help me or suggest me a solution? Because when I add a new image through webservice, the field is_sphere is 0 by default. Thank you!

mistic100 commented 7 years ago

I have no solution, the list of updatable fields is hardcoded here https://github.com/Piwigo/Piwigo/blob/master/ws.php#L675 and here https://github.com/Piwigo/Piwigo/blob/master/include/ws_functions/pwg.images.php#L1597

You can open a request on Piwigo repository to make this extendable by plugins.

mistic100 commented 7 years ago

@plegall thoughts ? it would be better for plugins to extend the core service than adding a new service.

Spettacolo83 commented 7 years ago

Thank you guys! I've modified as follow:

  $info_columns = array(
    'name',
    'author',
    'comment',
    'date_creation',
    'is_sphere',
    );

Now it works as I would! Thank you very much!

mistic100 commented 7 years ago

very bad idea : the file will be overwritten during the next update of Piwigo and it will stop working and you will not remember you did the change.

Please fill a ticket on Piwigo repo.

Spettacolo83 commented 7 years ago

Thank you, but how can I do that?

mistic100 commented 7 years ago

Hmmm

https://github.com/Piwigo/Piwigo/issues

Spettacolo83 commented 7 years ago

Done it! Thank you!