-
Notifications
You must be signed in to change notification settings - Fork 0
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
Deep copy does not work as expected when using component types #52
Comments
Can you share the relevant part of your e.g.
contentTypes are opt-in, so if you don't have the the proper contentTypes defined then the button will not be shown. |
The config file is below: `module.exports = ({ env }) => ({
})` finally, I was able to show the button. we have a few configs in env/development and env/production. hovewer it does not copy. it seems it cannot read a data here: error: Cannot read properties of undefined (reading 'data') |
Good to read that you managed to get the button to appear. From the screenshot and the error message, I think you're hitting the current limits on the plugin. Would you be willing to create a minimal repro (either in GitHub, or in something like StackBlitz) so that I can investigate further? You could use the playground in this repository as a template. If that's too much work, can you share the "offending" content-type definition? |
Thanks! I'll take a look later today and implement a fix. Will keep you posted. |
I've just merged my work on the configurability changes. Could you try the latest version directly from github? You can do this by updating your package.json to:
|
I have tried:
so now I see in the console the following:
|
Thanks for getting back to me. It's weird that you have to build it manually, as the It seems that the plugin wasn't built properly on your machine: The fact that you're getting 404 on The url is It really should be working directly from npm because of the Can you try the following:
If it's not building automatically:
Thanks for bearing with me through this. Hope we can get it working. |
Okay, I've published the package as Can you try that one? |
it's better. I see the button, the dialog. but getting this: |
Hmm.. I'm having trouble making any sense of that error... Line 70 in The only part that's doing anything with I'm assuming you've tried this with a fresh start of the admin and node modules? It's pretty weird that the line number is so out of sync with the packaged files. It's disappointing that we can't seem to get it working. Maybe it has something to do with not having any unique fields in your content type definition. That should be pretty easy to fix on my side then. Would you be willing to share your content type definitions + configs? It would make it easier for me to reproduce the error and fix it. In any case, I'll continue my investigation. Let me know if you have any new info as well. |
ok. one more time:
prepareForCopy, line 21: config.uniqueFields even if I added this so ;-) conclusion - it still does not work for "Component"s |
Thanks for your analysis. It seems there is a regression for component types. I'll label this as a bug. For now, you can (probably?) work around this regression by defining the component types in the plugin config as well e.g.:
However, as component types don't live as entities in Strapi, they should be implicitly enabled as deep-copyable in the plugin. So I'll create a PR for that to fix that behavior. I'll update this issue accordingly. |
This should be fixed in https://github.com/Four-Lights-NL/strapi-plugin-deepcopy/tree/v1.0.0-rc.1 If you still encounter problems, please create a proper, shareable, reproduction of the problem using stackblitz or a similar tool. |
Using v1.0.0-rc0, trying to deep-copy a content-type which has component types results in an undefined error.
See #52 (comment) for more information.
Original text:
What could be a reason that DeepCopyButton is not shown?
The plugin is installed (I can see it in the list of plugins),
config/plugins.js is updated,
but still nothing.
yarn build, yarn develop - no matter what I ran - no result.
latest strapi (4.9.2 ... 4.11.1)
The text was updated successfully, but these errors were encountered: