Repository navigation
Conversation
* feat: relink uploaded files via file_ids on lead create
upload_lead_file now returns file_id alongside file_name/file_url.
create() accepts a file_ids key (comma-separated File names already
uploaded via upload_lead_file) and relinks those files to the new lead
via a single get_list + bulk db.set_value, instead of inserting
duplicate File records. The attachments key is retained for external
URLs only.
This avoids the duplicate File rows and the DFP External Storage
rejection ("http(s)://file(s) not ready to be saved...") that occurred
when an already-uploaded or external URL was passed through the old
insert path.
* feat: handle already-attached file_ids on lead create
Only relink files that are not yet attached, so re-sending a file id
already linked elsewhere is no longer silently moved.
Such ids now have their file_url queued as a new File, which DFP points
at the same stored object (a shared copy), instead of being skipped.
* refactor: scope file_ids lookup via a single permission-checked get_list
Addresses PR review feedback:
- guard empty/whitespace file_ids before querying
- fetch name, attached_to_name and file_url in one get_list instead of
an N+1 get_value loop
- scope both the relink and reuse paths through get_list permissions so a
caller can only act on files it can read
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release v1.0.1 — promotes
developtomain.Included
file_idsattachment handling onCRM Leadcreation (feat: relink uploaded files via file_ids on lead create #6)upload_lead_filereturnsfile_id;createacceptsfile_idsto re-link already-uploaded files to the new lead (no duplicateFile), with a single permission-scopedget_list.file_idalready attached elsewhere is not moved — a newFileis created from itsfile_url, which DFP points at the same stored object (shared copy, no re-upload).http(s)://file(s) not ready to be saved…) and the duplicate-File/ "Local file not found" failures from the old external-URL path.file_idsupload-first flow; plugin repo link renamedgravityforms-erpnextcrm→gravityforms-frappecrm.__version__bumped1.0.0→1.0.1(chore(release): bump __version__ to 1.0.1 #7).Version
1.0.0→1.0.1