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

FIX get list of product's documents #16107

Closed
wants to merge 1 commit into from
Closed

FIX get list of product's documents #16107

wants to merge 1 commit into from

Conversation

ptibogxiv
Copy link
Contributor

fix getting documents for products

@eldy maybe need better code for getting from old path

@@ -425,7 +425,7 @@ public function getDocumentsListByElement($modulepart, $id = 0, $ref = '', $sort
throw new RestException(500, 'Error while fetching object: '.$object->error);
}

$upload_dir = $conf->product->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 0, $object, 'product').dol_sanitizeFileName($object->ref);
$upload_dir = $conf->product->multidir_output[$object->entity]."/".dol_sanitizeFileName($object->ref);
Copy link
Member

@eldy eldy Jan 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting of path must use the get_exdir (to prepare the future).
Can you check if this fix the trouble:
upload_dir = $conf->product->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 0, $object, 'product')

Don't worry about the old path. API was surely introduced after we switch to new path.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems to be better i get this but different of other objects. don't really easy for integration of this...

{
"0": {
"name": "PT2012-0002-xxx_squarred.jpg",
"path": "/volume2/web/dolibarr/documents/produit/PT2012-0002",
"level1name": "PT2012-0002",
"relativename": "PT2012-0002-xxx_squarred.jpg",
"fullname": "/volume2/web/dolibarr/documents/produit/PT2012-0002/PT2012-0002-xxx_squarred.jpg",
"date": 1611946023,
"size": 3988,
"type": "file"
},
"ecmfiles_infos": [
{
"label": "96549a7e68ebfbb2b2cc32764bcaac4b",
"entity": "1",
"filename": "PT2012-0002-xxx_squarred.jpg",
"filepath": "produit/PT2012-0002",
"fullpath_orig": "xxx_squarred.jpg",
"description": "",
"keywords": null,
"cover": null,
"position": "2",
"gen_or_uploaded": "uploaded",
"extraparams": null,
"date_c": 1611949623,
"date_m": 1611949623,
"fk_user_c": "1",
"fk_user_m": null,
"acl": null,
"src_object_type": "product",
"src_object_id": "2",
"id": "45",
"ref": null,
"share": null
}
]
}

@eldy eldy added the PR to fix or conflict to solve PR needs to be fixed to be integrated (except for conflicts, a comment describes the fix to do) label Jan 30, 2021
eldy added a commit that referenced this pull request Jan 30, 2021
@eldy eldy closed this Jan 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR to fix or conflict to solve PR needs to be fixed to be integrated (except for conflicts, a comment describes the fix to do)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants