danmunn / redmine_dmsf

Fork of svn repository for redmine_dmsf
GNU General Public License v2.0
413 stars 193 forks source link

API call "commit" not accepting "custom_version_major", "custom_version_minor" anymore? #1452

Closed litzenbergerm closed 1 year ago

litzenbergerm commented 1 year ago

After migration to 3.0.12 the file upload via the API commit call seems not to accept the "custom_version_major", "custom_version_minor" fields anymore, when I upload a new version of an existing file?

Regardless of what "custom_version_major", "custom_version_minor" I pass with the call the version of the committed file stays with the previous version of the file.

   mycommit = { 'attachments': 
        {'folder_id': folderid,
        'uploaded_file': {
            'token': token,
            'version': '3',
            'custom_version_major': myrev[0],
            'custom_version_minor': myrev[1],
            'name': fname,
            'title': title,
            'description': description,
            'comment': comment 
    }}}
    uurl = self.url + 'projects/'+project+'/dmsf/commit.json'
    myfields = json.dumps(mycommit)
    resp = self.http.request('POST', 
           uurl, 
           body = myfields.encode('utf-8'),
           headers = self.hd) 

Environment: Redmine version 5.0.5.stable Ruby version 3.0.2-p107 (2021-07-07) [x86_64-linux-gnu] Rails version 6.1.7.2 Environment production Database adapter Mysql2 Mailer queue ActiveJob::QueueAdapters::AsyncAdapter Mailer delivery smtp Redmine settings: Redmine theme Ait (includes JavaScript) SCM: Subversion 1.14.1 Git 2.34.1 Filesystem
Redmine plugins: redmine_dmsf 3.0.12

picman commented 1 year ago

I think that there is a mistake in the wiki. There should be _versionmajor and _versionminor instead of _custom_versionmajor and _custom_versionminor. Could you re-try it with _versionmajor and _versionminor?

picman commented 1 year ago

I think too, that 'version': '3', makes no sense.

litzenbergerm commented 1 year ago

Ok, that fixed it! Thank you for the fast reaction!

However, I am pretty sure the code give in the issue was working for 3 years on a previous version of DMSF (can't recall the exact ver. now).

Am Do., 25. Mai 2023 um 08:14 Uhr schrieb Karel Pičman < @.***>:

I think too, that 'version': '3', makes no sense.

— Reply to this email directly, view it on GitHub https://github.com/danmunn/redmine_dmsf/issues/1452#issuecomment-1562335988, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQFOTWXJLI6HCGQNIIWPUTLXH32DJANCNFSM6AAAAAAYOKTW5U . You are receiving this because you authored the thread.Message ID: @.***>

picman commented 1 year ago

Yeah, I have probably changed that in the code and omitted to update the wiki. It isn't mentioned in the changelog either, sorry. Wiki updated.