Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"group_id is invalid" error #133

Closed
vipulnsward opened this issue Mar 8, 2024 · 0 comments · Fixed by #135
Closed

"group_id is invalid" error #133

vipulnsward opened this issue Mar 8, 2024 · 0 comments · Fixed by #135
Assignees
Labels

Comments

@vipulnsward
Copy link
Collaborator

vipulnsward commented Mar 8, 2024

Describe the bug

When they uploading more then 10 files we get a "group_id is invalid" error.

Works well with 5 files.

After submitting the form, url is being saved in the model

# UploadcareDocument (with mount_uploadcare_file_group :attachments from the gem), and we do that 

uploadcare_document.attachments.load.files.each do |file|
  document = build_content_file(file)
  document = upload_file(document)
  delete_file_from_uploadcare(file)

  document.save!
  self.document = document
end

def build_content_file(file)
  uploadcare_uploaded_file = Uploadcare::FileApi.get_file(file.uuid)
  uploadcare_document.content_files.new(
    uploadcare_uploaded_file: uploadcare_uploaded_file,
    item_attributes: item_attributes(file)
  )
end

Expected behavior

There should be no errors

Code / screenshots

Environment

  • Library version: 3.3.4
  • Language/framework version:
  • OS version:
@vipulnsward vipulnsward added the bug label Mar 8, 2024
@vipulnsward vipulnsward self-assigned this Mar 8, 2024
vipulnsward added a commit that referenced this issue Mar 24, 2024
…and this did not work for more than 10 files in id
vipulnsward added a commit that referenced this issue Mar 24, 2024
…s did not work for more than 10 files in id (#135)

* [#133] Fix that we were trying use regex to match ID as single digit and this did not work for more than 10 files in id

* Add specs for group id matching on GROUP_ID_REGEX

* Add changelog and prepare for release

* Rubocop fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant