Fix: BO - Import/Export - Can't import Store contact
The problem depends on the fact that when importing store contacts, the
PrestaShopLogger->object_type property
is set with "Store contacts" which does not pass the validation of the Validate::isValidObjectClassName() method. So in this case I thought of valorising the $import_type variable with StoreContacts which passes the validation and the error no longer occurs.
| Questions | Answers |
|---|---|
| Branch? | 8.1.x |
| Type? | bug fix |
| Category? | FO |
| BC breaks? | no |
| Deprecations? | no |
| UI | https://github.com/florine2623/testing_pr/actions/runs/8049269672 ✅ |
| Fixed issue or discussion? | Fixes #35009 |
Hi, thanks for this contribution!
I found some issues with the Pull Request description:
- The
descriptionshouldn't be empty. - Your pull request does not seem to fix any issue, consider creating one (see note below) and linking it by writing
Fixes #1234.
Would you mind having a look at it? This will help us understand how interesting your contribution is, thank you very much!
About linked issues
Please consider opening an issue before submitting a Pull Request:
- If it's a bug fix, it helps maintainers verify that the bug is effectively due to a defect in the code, and that it hasn't been fixed already.
- It can help trigger a discussion about the best implementation path before a single line of code is written.
- It may lead the Core Product team to mark that issue as a priority, further attracting the maintainers' attention.
(Note: this is an automated message, but answering it will reach a real human)
This is weird, how come the translated string works for all other types?
Oh, so isValidObjectClassName doesn't accept spaces? And all the other types that are translated work by accident? What if some language translates it with some nonsupporter character, then it also won't work.
This is weird, how come the translated string works for all other types?
I tried in PS 8.1.2 where the strings are all single words, except 'Store contacts' which is the only one that generates the error, because there is a space between the 2 words.
What version of PS does your screenshot refer to? I understand to check 'Supply Orders' and 'Supply Order Details' you need to activate 'PS_ADVANCED_STOCK_MANAGEMENT'.
Yes, you are right, in case of translation with spaces it would give an error. Perhaps it would be better to set the "$import_type" variable manually.
When I try to import it a second time, I have the initial error :
Hi @florine2623, when you import the file check if the URL in the "image" field exists, otherwise you must skip that field because this generates an error as the URL does not exist. However, now I make a change to avoid this error too.
I uploaded a new edit to check if the store image to import actually exists.
@florine2623 can you check if you still have the error?
QA approved, well done! Message to the maintainers: do not forget to milestone it before the merge.
Hello @Codencode ,
Thanks for the update ^^
For the issue #35009 , it is fixed ✅ Tested with/without images.
Screen.Recording.2024-02-27.at.16.18.04.mov 2nd attempt, OK :
Screen.Recording.2024-02-27.at.16.23.46.mov But for the issue #34974 , there's still an error and it can be tested entirely :
Screen.Recording.2024-02-27.at.16.19.52.mov For me it is QA ✅ But the PR #34974 will need another PR to test/fix the issue.
Ok, I removed the reference to the ISSUE in the description.
Thanks!
Hi @Codencode, can you fix the CI before we can merge the PR ?
Hi @mflasquin, I fixed.
Thanks!
thanks @Codencode