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

CustomTypes - Does not export when the uid value contains a forward slash "/" #56

Closed
tochiedev opened this issue May 13, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@tochiedev
Copy link

tochiedev commented May 13, 2022

Bug report

Describe the bug

This happened when using customType in the plugin config. Not all data was exported to json.

Steps to reproduce the behavior

When the value of the "uid" field value contains a forward slash e.g "Boy / Girl", it does not export this database row to json file.

Expected behavior

Should export "uid" field values with a forward slash.

System

  • Node.js version: ">=12.x.x <=16.x.x"
  • NPM version: ">=6.0.0"
  • Strapi version: "4.1.6"
  • Plugin version: "^1.0.1"
  • Database: Postgres
  • Operating system: Mac
@boazpoolman boazpoolman added bug Something isn't working Needs investigation Further information is requested labels May 13, 2022
@boazpoolman
Copy link
Member

Hey @tochiedev

Thanks for reporting the issue.

On Unix-like systems, / is reserved. On Windows, <>:"/|?* along with trailing periods are reserved.

I've allready once escaped the : character and replaced it with # for windows.
I can add another one to escape / and replace it with $.

Can you test the solution I've described above in this PR #57?

yarn add boazpoolman/strapi-plugin-config-sync#pull/57/head
npm install boazpoolman/strapi-plugin-config-sync#pull/57/head

@boazpoolman boazpoolman removed the Needs investigation Further information is requested label May 13, 2022
@boazpoolman
Copy link
Member

Hi @tochiedev

Have you had time to test out the PR I've made for this issue?

@tochiedev
Copy link
Author

Hi @boazpoolman

Apologies! Sorry, I couldn't get back earlier. I was working on another project and only just had the chance to test it out.

Yes, the PR solved the issue.

However, in testing it, I observed something -

  • I used an existing row which had name field as "Oil & Gas", this had an id (auto-incremental) value of 1.
  • I changed the name to "Oil / Gas", exported locally and imported on the production app.
  • Import was successful but it was recorded as a new row "Oil / Gas" (id:5), instead of overwriting the existing "Oil & Gas" (id:1).

Is this how it's intended to work?
In a case where the auto-incremental id is already used in relationships, how do I modify the name and maintain its existing id?

Thanks for your time.

@boazpoolman
Copy link
Member

Hi @tochiedev

That would imply that the uid value of this config entity has changed.
In that case it will have deleted the old entity and created a new entity as it couldn't match the entites by uid anymore.
This is how it is intended to work.

@boazpoolman
Copy link
Member

This was released with v1.0.2 of the plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants