Coder Social home page Coder Social logo

strapi-plugin-duplicate-button's People

Contributors

dupflo avatar lautr avatar paulwellnerbou avatar penguinofwar avatar snowflaki avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

strapi-plugin-duplicate-button's Issues

Doesn't work with components / dynamic zone: returning "id" - duplicate key value violates unique constraint "files_related_morphs_pkey"

I was just trying out the duplicate button, as I wanted to duplicate a whole page including several components and their content. I receive a long error in Strapi:

error: insert into "public"."files_related_morphs" ("field", "file_id", "order", "related_id", "related_type") values ($1, $2, $3, $4, $5), ($6, $7, $8, $9, $10), ($11, $12, $13, $14, $15), ($16, $17, $18, $19, $20), ($21, $22, $23, $24, $25), ($26, $27, $28, $29, $30), ($31, $32, $33, $34, $35), ($36, $37, $38, $39, $40), ($41, $42, $43, $44, $45), ($46, $47, $48, $49, $50), ($51, $52, $53, $54, $55), ($56, $57, $58, $59, $60), ($61, $62, $63, $64, $65), ($66, $67, $68, $69, $70), ($71, $72, $73, $74, $75), ($76, $77, $78, $79, $80), ($81, $82, $83, $84, $85), ($86, $87, $88, $89, $90), ($91, $92, $93, $94, $95), ($96, $97, $98, $99, $100) returning "id" - duplicate key value violates unique constraint "files_related_morphs_pkey"
error: insert into "public"."files_related_morphs" ("field", "file_id", "order", "related_id", "related_type") values ($1, $2, $3, $4, $5), ($6, $7, $8, $9, $10), ($11, $12, $13, $14, $15), ($16, $17, $18, $19, $20), ($21, $22, $23, $24, $25), ($26, $27, $28, $29, $30), ($31, $32, $33, $34, $35), ($36, $37, $38, $39, $40), ($41, $42, $43, $44, $45), ($46, $47, $48, $49, $50), ($51, $52, $53, $54, $55), ($56, $57, $58, $59, $60), ($61, $62, $63, $64, $65), ($66, $67, $68, $69, $70), ($71, $72, $73, $74, $75), ($76, $77, $78, $79, $80), ($81, $82, $83, $84, $85), ($86, $87, $88, $89, $90), ($91, $92, $93, $94, $95), ($96, $97, $98, $99, $100) returning "id" - duplicate key value violates unique constraint "files_related_morphs_pkey"

that is most likely related to components ? I don't know exactly what needs to be done to support cloning of content in dynamic zones, but I would love to see that being supported (and again wondering how this isn't a native strapi feature)

Strapi 4: Different behaviour than Strapi's duplicate button

In Strapi 4, the behaviour of this button is different than the behaviour of Strapi's duplicate button in the list:

  • The default Strapi calls the auto-clone endpoint and saves the the duplicated entity and shows the already saved data.
  • This button opens the cloned data (without saving) and calls the clone endpoint afterwards

While I personally prefer the second approach in principle, I would still like to do both methods the exakt same things.

In addition to that, the Strapi duplicate feature (Strapi 4.2.24) is not removing the backreferences of localized entities. I implemented a workaround for this, with works fine in our case, but it only works for the default Strapi behaviour.

Strapi 5

Do you plan to support strapi v5?

Update Node Version to support 18.x.x

First of all, thank you for making this plugin!

Next, I would make a PR but I'm not adept at Node.JS versioning and Node.JS in general, it would be great if you could release a versoin that supports node 18.7.0

warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/5] ๐Ÿ”  Validating package.json...
[2/5] ๐Ÿ”  Resolving packages...
[3/5] ๐Ÿšš  Fetching packages...
error [email protected]: The engine "node" is incompatible with this module. Expected version ">=12.x.x <=16.x.x". Got "18.7.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

Activation Issue

I have installed the plugin but there is no place or option to activate it. Please help, Thank you.

Duplicate button does not render.

Followed install docs.

received this error
strapi exited with code 1 strapi | yarn run v1.22.19 strapi | $ strapi develop strapi | [2022-08-26 17:53:10.790] debug: โ›”๏ธ Server wasn't able to start properly. strapi | [2022-08-26 17:53:10.796] error: The "path" argument must be of type string. Received undefined strapi | TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined strapi | at new NodeError (node:internal/errors:387:5) strapi | at validateString (node:internal/validators:121:11) strapi | at join (node:path:1172:7) strapi | at Object.loadPlugins (/opt/node_modules/@strapi/strapi/lib/core/loaders/plugins/index.js:88:34) strapi | at async Strapi.loadPlugins (/opt/node_modules/@strapi/strapi/lib/Strapi.js:319:5) strapi | at async Promise.all (index 2) strapi | at async Strapi.register (/opt/node_modules/@strapi/strapi/lib/Strapi.js:355:5) strapi | at async Strapi.load (/opt/node_modules/@strapi/strapi/lib/Strapi.js:456:5) strapi | at async Strapi.start (/opt/node_modules/@strapi/strapi/lib/Strapi.js:198:9) strapi | error Command failed with exit code 1. strapi | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

module.exports = () => ({
'duplicate-button': true,
});

If I change true to a string strapi runs but duplicate button does not.

"dependencies": {
"@strapi/plugin-i18n": "4.3.6",
"@strapi/plugin-users-permissions": "4.3.6",
"@strapi/strapi": "4.3.6",
"better-sqlite3": "7.4.6",
"pg": "^8.8.0",
"strapi-plugin-duplicate-button": "^1.0.4"
},

Conflicts

Hi, have some conflicts with other plugins, can you fix it.

npm install strapi-plugin-duplicate-button

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: @strapi/[email protected]
npm ERR! Found: @strapi/[email protected]
npm ERR! node_modules/@strapi/strapi
npm ERR!   peer @strapi/strapi@"^4.11.0" from [email protected]
npm ERR!   node_modules/strapi-plugin-menus
npm ERR!     strapi-plugin-menus@"^1.5.0" from the root project
npm ERR!   peer @strapi/strapi@"^4.4.0" from [email protected]
npm ERR!   node_modules/strapi-plugin-multi-select
npm ERR!     strapi-plugin-multi-select@"^1.2.2" from the root project
npm ERR!   9 more (@strapi/admin, @strapi/data-transfer, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @strapi/strapi@"4.0.0" from @strapi/[email protected]
npm ERR! node_modules/@strapi/plugin-users-permissions
npm ERR!   @strapi/plugin-users-permissions@"4.15.2" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: @strapi/[email protected]
npm ERR! node_modules/@strapi/strapi
npm ERR!   peer @strapi/strapi@"4.0.0" from @strapi/[email protected]
npm ERR!   node_modules/@strapi/plugin-users-permissions
npm ERR!     @strapi/plugin-users-permissions@"4.15.2" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! 
npm ERR! For a full report see:
npm ERR! /Users/thomasentlicher/.npm/_logs/2023-11-14T09_34_54_418Z-eresolve-report.txt

Thanks,
Thomas

Does not check for unique value rules

If an item has a field called Value that is set to be required and unique and you click the Duplicate button to go to the "...create/clone/" endpoint, you are able to save the cloned item with the same value again that is supposed to be unique.

image

image

no button rendered in admin dashboard

Hi, is this still working for Strapi with version v4.10.X and Node version > 16?

I've followed the instructions and can see
"strapi-plugin-duplicate-button": "^1.1.7"
in my package.json

I've also added 'duplicate-button': true to config/plugins.js

Duplicate Button is also now listed in my plugin on the localhost:1337 Dashboard.

However, I don't see the button displaying in the edit view for any of my collection types. What do you recommend?

Thanks for any insight!

Bug: Build failed @strapi/strapi 4.15.4

Error details

> strapi build

โœ” Compiling TS (1873.3834049999714ms)
โ ‹ Building build context
โ ™ Building build context[INFO] Including the following ENV variables as part of the JS bundle:
    - ADMIN_PATH
    - STRAPI_ADMIN_BACKEND_URL
    - STRAPI_TELEMETRY_DISABLED
โœ” Building build context (258.95838099718094ms)
โ ‹ Building admin panel
โ ธ Building admin panel[ERROR] Module not found: Error: Package path ./admin/src/content-manager/hooks/usePluginsQueryParams is not exported from package /app/node_modules/@strapi/admin (see exports field in /app/node_modules/@strapi/admin/package.json)
โœ– Building admin panel
[ERROR]  There seems to be an unexpected error, try again with --debug for more information 

Not working with single type ?

Hello,

The plugin works well with collection type but for single type it doesn"t seem to be the case or something is missing with my configuration ?

Incompatible versions of the plugin

The current plugin version according to the package.json file is 1.1.5. But the version on the npmjs.com is old (1.0.4) which is an issue for users who are trying to install the plugin from the npmjs.com repository.

Not working with versioning

HI i think this function is not working with versionning app. Every time im creating new duplicate and publishing it the orginal content record is removed.

Plugin incompatible with Strapi v4.15.2+

Hi!

I think the plugin is not compatible with the Strapi version v4.15.2+.
Apparently, it imports a module from Strapi source code that is not documented and it changed in this version of Strapi, resulting in an error at build:

โ ง Building admin panel [ERROR] Module not found: Error: Package path ./admin/src/content-manager/hooks/usePluginsQueryParams is not exported from package my-project/node_modules/@strapi/admin

Removing the plugin fixes the build command.

See strapi/strapi#18711

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.