icaruseu / mom-ca

Monasterium.net (http://www.monasterium.net/mom) - repository and collaborative archive
https://github.com/icaruseu/mom-ca/wiki
GNU General Public License v3.0
17 stars 11 forks source link

toggle own/public version in user collection throws an 400 error #1057

Open GVogeler opened 2 years ago

GVogeler commented 2 years ago

I try to change the status of a charter in https://www.monasterium.net/mom/my-collections-edit from "public version" to "own version" (and vice-a-versa): grafik The JS console returns an 400 Bad Reques error for POST https://www.monasterium.net/mom/service/my-collection-charter-toggle-just-link and the value of atom:content/@src remains unchanged.

GVogeler commented 2 years ago

Currently only reproducable in user collection illuminierteUrkunden.

NTsch commented 1 year ago

The my-collection-charter-toggle-just-link service checks xrx.user/[user]/metadata.charter/ for a charter with an atom:id that ends with the object-ID, e.g. '1418-02-06_Wien'. If this returns more than one charter, this causes the error. In this case, there exist two:

/db/mom-data/xrx.user/illuminierteurkunden%40gmail.com/metadata.charter/IlluminierteUrkunden/1418-02-06_Wien.charter.xml
/db/mom-data/xrx.user/illuminierteurkunden%40gmail.com/metadata.charter/IlluminierteUrkundenKurie/1418-02-06_Wien.charter.xm

Solution would be to concat the ID of the current collection to the path checked by the service.

StephanMa commented 1 year ago

I would suggest... switching from string comparison to atom:id? the atom:id contains the collection.

The Atom:ID in metadata.charter.public corresponds the the one in the user specific metadata.charter