Giter Club home page Giter Club logo

strapi-plugin-slugify's Introduction

strapi-plugin-slugify

A plugin for Strapi that provides the ability to auto slugify a field for any content type. It also provides a findOne by slug endpoint as a utility.

Downloads Install size Package version

Requirements

The installation requirements are the same as Strapi itself and can be found in the documentation on the Quick Start page in the Prerequisites info card.

Supported Strapi versions

  • v4.x.x

NOTE: While this plugin may work with the older Strapi versions, they are not supported, it is always recommended to use the latest version of Strapi.

Installation

npm install strapi-plugin-slugify

# or

yarn add strapi-plugin-slugify

Configuration

The plugin configuration is stored in a config file located at ./config/plugins.js.

Please note that the field referenced in the configuration file must exist. You can add it using the Strapi Admin UI. Also note that adding a field at a later point in time will require you to unpublish, change, save and republish the entry/entries in order for this plugin to work correctly.

A sample configuration

module.exports = ({ env }) => ({
  // ...
  slugify: {
    enabled: true,
    config: {
      contentTypes: {
        article: {
          field: 'slug',
          references: 'title',
        },
      },
    },
  },
  // ...
});

This will listen for any record created or updated in the article content type and set a slugified value for the slug field automatically based on the title field.

Note: To rewrite the same field (e.g. title is both a reference and a slug) use title as the field and references value.

Note: Compound slugs (basing the slug on multiple fields) can be achieved by passing an array of fields to the references property (e.g. references: ['date','title']).

IMPORTANT NOTE: Make sure any sensitive data is stored in env files.

Additional Requirement for GraphQL

Per #35 please ensure that the slugify plugin configuration is placed before the graphql plugin configuration.

The Complete Plugin Configuration Object

Property Description Type Default Required
contentTypes The Content Types to add auto slugification and search findOne by slug search utility to Object {} No
contentTypes[modelName] The model name of the content type (it is the singularName in the model schema) String N/A Yes
contentTypes[modelName]field The name of the field to add the slug String N/A Yes
contentTypes[modelName]references The name(s) of the field(s) used to build the slug. If an array of fields is set it will result in a compound slug String or Array N/A Yes
slugifyWithCount Duplicate strings will have their occurrence appended to the end of the slug Boolean false No
shouldUpdateSlug Allow the slug to be updated after initial generation. Boolean false No
skipUndefinedReferences Skip reference fields that have no data. Mostly applicable to compound slug Boolean false No
slugifyOptions The options to pass the the slugify function. All options can be found in the slugify docs Object {} No

Usage

Once the plugin has been installed, configured and enabled the configured content types will have the following additional functionality

Slugification

Any time the respective content types have an entity created or updated the slug field defined in the settings will be auto generated based on the provided reference field.

Find One by Slug

Hitting the /api/slugify/slugs/:modelName/:slug endpoint for any configured content types will return the entity type that matches the slug in the url. Additionally the endpoint accepts any of the parameters that can be added to the routes built into Strapi.

IMPORTANT The modelName is case sensitive and must match exactly with the name defined in the configuration.

Additional Requirements

Like all other created API endpoints the findSlug route must be allowed under User & Permissions -> Roles -> Public/Authenticated for the user to be able to access the route.

Examples

Example Request

Making the following request with the sample configuration will look as follows

REST

await fetch(`${API_URL}/api/slugify/slugs/article/lorem-ipsum-dolor`);
// GET /api/slugify/slugs/article/lorem-ipsum-dolor

GraphQL

{
  findSlug(modelName:"article",slug:"lorem-ipsum-dolor"){
    ... on ArticleEntityResponse{
      data{
        id
        attributes{
          title
        }
      }
    }
  }
}

Additionally if draftAndPublish is enabled for the content-type a publicationState arg can be passed to the GraphQL query that accepts either preview or live as input.

IMPORTANT Please beware that the request for an entry in preview will return both draft entries & published entries as per Strapi default.

{
  findSlug(modelName:"article",slug:"lorem-ipsum-dolor",publicationState:"preview"){
    ... on ArticleEntityResponse{
      data{
        id
        attributes{
          title
        }
      }
    }
  }
}

Example Response

If an article with the slug of lorem-ipsum-dolor exists the response will look the same as a single entity response

REST

Successful Response
{
  "data": {
    "id": 1,
    "attributes":{
      "title": "lorem ipsum dolor",
      "slug": "lorem-ipsum-dolor",
      "createdAt": "2022-02-17T01:49:31.961Z",
      "updatedAt": "2022-02-17T03:47:09.950Z",
      "publishedAt": null
    }
  }
}
Error Response

To be inline with Strapi's default behavior for single types if an article with the slug of lorem-ipsum-dolor does not exist a 404 error will be returned.

{
  "data": null,
  "error": { 
    "status": 404, 
    "name": "NotFoundError", 
    "message": "Not Found", 
    "details": {} 
  }
}

GraphQL

Successful Response
{
  "data": {
    "findSlug": {
      "data": {
        "id": "1",
        "attributes": {
          "title": "lorem ipsum dolor"
        }
      }
    }
  }
}
Error Response

To be inline with Strapi's default behavior for single types if an article with the slug of lorem-ipsum-dolor does not exist the data will be null.

{
  "data": {
    "findSlug": {
      "data": null
    }
  }
}

Bugs

If any bugs are found please report them as a Github Issue

strapi-plugin-slugify's People

Contributors

amolmungusmare avatar comfortablycoding avatar danielpantle avatar domdew avatar maxostarr avatar selected-pixel-jameson avatar tpiros avatar

Stargazers

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

Watchers

 avatar

strapi-plugin-slugify's Issues

Cannot read properties of undefined (reading 'admin::permission') strapi 4.1.7

[2022-04-07 23:32:20.574] info: [slugify] graphql detected, registering queries
[2022-04-07 23:32:20.917] debug: ⛔️ Server wasn't able to start properly.
[2022-04-07 23:32:20.918] error: Cannot read properties of undefined (reading 'admin::permission')
TypeError: Cannot read properties of undefined (reading 'admin::permission')

slugifyWithCount is non persistent between project restarts

I don't want duplicate slugs to be allowed in any capacity. However, I'm noticing that when the first duplicate slug is generated it doesn't append the correct -1 to it. For example:

Title = "Test"
Slug = "test"

Title = "Test" ( In this case the slug should be generated as test-1, but it's not.)
Slug = "test"

Title = "Test" ( In this case the slug should come out as test-2)
Slug = "test-2"

So for some reason the first time a duplicate slug is generated the count is not getting attached to the generated slug. However, the next time a duplicate slug is generated the count is attached correctly.

These are the setting I have
``
slugify: {
enabled: true,
config: {
slugifyWithCount: true,
contentTypes: {
jam: {
field: 'slug',
references: 'title',
},
track: {
field: 'slug',
references: 'title'
},
},
},
},


I'm using the latest version `2.3.1`

What's the difference between this plugin and the strapi native slug field?

In strapi, a slug can be obtained by defining it on model schema like this

...
"title": {
    "type": "string",
    "required": true
},
"slug": {
    "type": "uid",
    "targetField": "title"
}

This will generate a slug field on the model and in the admin interface we can automatically generate slug based on title

image

Duplicate button on the collection list item causes slugify to disallow duplication feature

I was using an unofficial duplicate button, but it seems that Strapi has its own duplicate feature baked into the code now.

After uninstalling the duplicate plugin, I noticed the duplicate button for the list collection item.

Screenshot from 2022-11-25 13-53-55

I added the slugifyWithCount option to see if it would at least create a new slug if has the same slug, but that resulted in the same error as shown above.

This is the URL that is used when "cloning" a collection type.

https://example.com/admin/content-manager/collectionType/api::post.post/create/clone/2?plugins[i18n][locale]=en

In reference to unofficial plugin: lautr/strapi-plugin-duplicate-button#7 (comment)

Localized slug bug?

I note that if I enter the translated slug it does not find it, I think it would be a good idea to include this.

Example:
/api/slugify/slugs/article/dogs

{
  "data": {
    "id": 1,
    "attributes":{
      "title": "LIttle dogs",
      "slug": "dogs",
      //....
    }
  }
}

Localized Example
/api/slugify/slugs/article/perros

{
  "data": null,
  "error": { 
    "status": 404, 
    "name": "NotFoundError", 
    "message": "Not Found", 
    "details": {} 
  }
}

Strapi can't start up with plugin slugify

Hi,
Strapi crashes as son as I enable the Plugin.
The command yarn dev lead to a crash with the following error:
error: Cannot read property 'admin::permission' of undefined TypeError: Cannot read property 'admin::permission' of undefined

graphql: { enabled: true, config: { endpoint: '/graphql', shadowCRUD: true, playgroundAlways: false, depthLimit: 7, amountLimit: 100, apolloServer: { tracing: false, }, }, }, slugify: { enabled: false, config: { contentTypes: { page: { field: 'slug', references: 'title', }, }, }, },
Using Node 14
"@strapi/plugin-graphql": "^4.1.5",
"strapi-plugin-slugify": "^2.2.1"
"@strapi/strapi": "4.1.5",

When GraphQL is Disabled it works.

The "path" argument must be of type string. Received undefined

Hello,
I've been trying to setup the plugin, and it keeps failinf when running yarn develop

I'm using Yarn version 4.1.3, and have Node 16.14.0

Here is how I set up the configuration:

slugify: {
  enabled: true,
  config: {
    contentTypes: {
      article: {
        field: 'slug',
        references: 'title',
      },
    },
  },
},

I also installed graphql, and tried to set the configuration before and after gql's configuration, but in vain.

I get the following error:

[2022-03-15 19:41:03.263] debug: ⛔️ Server wasn't able to start properly.
[2022-03-15 19:41:03.264] error: The "path" argument must be of type string. Received undefined
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at new NodeError (node:internal/errors:371:5)
    at validateString (node:internal/validators:120:11)
    at join (node:path:1172:7)
    at Object.loadPlugins (/Users/joseph/DEV/overlord/api/node_modules/@strapi/strapi/lib/core/loaders/plugins/index.js:89:34)
    at async Strapi.loadPlugins (/Users/joseph/DEV/overlord/api/node_modules/@strapi/strapi/lib/Strapi.js:277:5)
    at async Promise.all (index 1)
    at async Strapi.register (/Users/joseph/DEV/overlord/api/node_modules/@strapi/strapi/lib/Strapi.js:309:5)
    at async Strapi.load (/Users/joseph/DEV/overlord/api/node_modules/@strapi/strapi/lib/Strapi.js:407:5)
    at async Strapi.start (/Users/joseph/DEV/overlord/api/node_modules/@strapi/strapi/lib/Strapi.js:161:9)
error Command failed with exit code 1.

I don't really know what I should do, if I need to delete my content type or if the error is from somewhere else?

Thank you in advance

Duplicated slugs are created

Hi,

Just testing this package, and when I set two entries to have the same title the slug is identical for both entries. I tried setting the field as unique which appears have no difference. Is there a setting somewhere to accommodate only unique slugs?

slug with count

When I add a slug with count, with references: title, for exemple. it changes the number each time I save the content, any field, so if someone bookmarks it, the link will not work if I update the content ...

Not working

Maybe, I'm just too stupid, but I can't make it work.

Installed the plugin via

yarn add strapi-plugin-slugify

Added it to the configuration:

    slugify: {
      enabled: true,
      config: {
        contentTypes: {
          article: {
            field: 'slug',
            references: 'title',
          },
        },
      },
    },

and rebuilt it via

yarn build

In Strapi (4.1.1, node v16.14.0), I can see that the plugin is enabled, but I can't query anything:

{
  "errors": [
    {
      "message": "Cannot query field \"findSlug\" on type \"Query\".",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "extensions": {
        "code": "GRAPHQL_VALIDATION_FAILED",
        "exception": {
          "stacktrace": [
            "GraphQLError: Cannot query field \"findSlug\" on type \"Query\".",
            "    at Object.Field (/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.js:48:31)",
            "    at Object.enter (/node_modules/graphql/language/visitor.js:323:29)",
            "    at Object.enter (/node_modules/graphql/utilities/TypeInfo.js:370:25)",
            "    at visit (/node_modules/graphql/language/visitor.js:243:26)",
            "    at validate (/node_modules/graphql/validation/validate.js:69:24)",
            "    at validate (/node_modules/apollo-server-koa/node_modules/apollo-server-core/dist/requestPipeline.js:186:39)",
            "    at processGraphQLRequest (/node_modules/apollo-server-koa/node_modules/apollo-server-core/dist/requestPipeline.js:98:34)",
            "    at processTicksAndRejections (node:internal/process/task_queues:96:5)",
            "    at async processHTTPRequest (/node_modules/apollo-server-koa/node_modules/apollo-server-core/dist/runHttpQuery.js:187:30)",
            "    at async /node_modules/apollo-server-koa/dist/ApolloServer.js:82:59",
            "    at async bodyParser (/node_modules/koa-bodyparser/index.js:95:5)",
            "    at async cors (/node_modules/@koa/cors/index.js:56:32)",
            "    at async returnBodyMiddleware (/node_modules/@strapi/strapi/lib/services/server/compose-endpoint.js:52:18)",
            "    at async policiesMiddleware (/node_modules/@strapi/strapi/lib/services/server/policy.js:24:5)",
            "    at async /node_modules/@strapi/strapi/lib/middlewares/logger.js:22:5",
            "    at async /node_modules/@strapi/strapi/lib/middlewares/powered-by.js:16:5"
          ]
        }
      }
    }
  ]
}

What am I doing wrong?

Oh and yes, a (collection) type named article (resp. articles in singular) exists, and it has a title attribute.

Plugin working with multiple locales

Hello, there are several languages, the plugin adds a slug field for each, they must be unique, but this is not the user's problem.
It would be great to implement such an option so that the locale is automatically substituted at the end.

// plugins.js
slugify: {
    enabled: true,
    config: {
      contentTypes: {
        post: {
          field: 'slug',
          references: ['title', 'locale'], // here locale not work 
        },
      },
    },
  },

As a result, when filling in the title: My super post, if the En locale is selected, the plugin will fill in the slug: my-super-post-en.
This will preserve uniqueness, add user friendliness, and make it easier to get a Post record with a selection by the slug field.

Not working on Strapi 4.11.5

Hello. I have a project running on Strapi 4.11.2 using this plugin with no issues. After updating Strapi to 4.11.5 I have the following error:

Error: Could not load js config file /node_modules/strapi-plugin-slugify/strapi-server.js: Cannot find module '@strapi/utils/lib/errors'
Require stack:
- node_modules/strapi-plugin-slugify/server/controllers/slug-controller.js

Node v16.20.1

Slugify and Strapiv4.1.2 with GraphQL - 'admin::permission' of undefined

  • Error message:
[2022-03-03 17:10:02.429] info: [slugify] graphql detected, registering queries
[2022-03-03 17:10:03.035] debug: ⛔️ Server wasn't able to start properly.
[2022-03-03 17:10:03.035] error: Cannot read property 'admin::permission' of undefined
TypeError: Cannot read property 'admin::permission' of undefined
at <folder>/node_modules/strapi-plugin-slugify/server/graphql/types.js:18:13
at <folder>/node_modules/lodash/lodash.js:4967:15
at baseForOwn (<folder>/node_modules/lodash/lodash.js:3032:24)
at <folder>/node_modules/lodash/lodash.js:4936:18
at Function.forEach (<folder>/node_modules/lodash/lodash.js:9410:14)
at getCustomTypes (<folder>/node_modules/strapi-plugin-slugify/server/graphql/types.js:17:4)
at extension (<folder>/node_modules/strapi-plugin-slugify/server/graphql/index.js:10:10)
at resolveConfig (<folder>/node_modules/@strapi/plugin-graphql/server/services/extension/extension.js:54:47)
at <folder>/node_modules/@strapi/plugin-graphql/server/services/extension/extension.js:59:74
at Array.reduce (<anonymous>)
at Object.generate (<folder>/node_modules/@strapi/plugin-graphql/server/services/extension/extension.js:58:22)
at buildMergedSchema (<folder>/node_modules/@strapi/plugin-graphql/server/services/content-api/index.js:103:55)
at Object.buildSchema (<folder>/node_modules/@strapi/plugin-graphql/server/services/content-api/index.js:54:20)
at Object.module.exports [as bootstrap] (<folder>/node_modules/@strapi/plugin-graphql/server/bootstrap.js:26:6)
at Object.bootstrap (<folder>/node_modules/@strapi/strapi/lib/core/domain/module/index.js:40:47)
at Object.bootstrap (<folder>/node_modules/@strapi/strapi/lib/core/registries/modules.js:28:19)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
  • Sample package.json
    "@strapi/plugin-graphql": "^4.1.2",
    "@strapi/plugin-i18n": "4.1.2",
    "@strapi/plugin-users-permissions": "4.1.2",
    "@strapi/strapi": "4.1.2",
    "sqlite3": "5.0.2",
    "strapi-plugin-slugify": "^2.1.1"
  • No additional plugin configuration.

  • Sample repo: https://github.com/vmptk/strapi-slug

strapi 4.14.0: no npm run develop compatibility with v.2.3.4 of strapi-plugin-slugify

System configuration

  • Strapi Version: 4.14.0
  • Operating System: MacOS 12.7
  • Database: mySQL 8.0.34 (using mysql2 as driver)
  • Node Version: 18.12.1
  • NPM Version: 9.8.0
  • Yarn Version: none
  • Dev language: typescript

Describe the problem

Installing strapi v.4.14.0, the npm run develop command fail with a blocking error message in the log.
Uninstalling strapi-plugin-slugify plugin, strapi works fine again.

Error log

Error: Could not load js config file .../server/node_modules/strapi-plugin-slugify/strapi-server.js: Cannot find module '@strapi/strapi/lib/core-api/controller/transform'
Require stack:
- .../server/node_modules/strapi-plugin-slugify/server/controllers/slug-controller.js
- .../server/node_modules/strapi-plugin-slugify/server/controllers/index.js
- .../server/node_modules/strapi-plugin-slugify/server/index.js
- .../server/node_modules/strapi-plugin-slugify/strapi-server.js
- .../server/node_modules/@strapi/utils/dist/import-default.js
- .../server/node_modules/@strapi/utils/dist/index.js
- .../server/node_modules/@strapi/data-transfer/dist/utils/components.js
- .../server/node_modules/@strapi/data-transfer/dist/strapi/queries/entity.js
- .../server/node_modules/@strapi/data-transfer/dist/strapi/queries/index.js
- .../server/node_modules/@strapi/data-transfer/dist/strapi/providers/local-destination/strategies/restore/index.js
- .../server/node_modules/@strapi/data-transfer/dist/strapi/providers/local-destination/strategies/index.js
- .../server/node_modules/@strapi/data-transfer/dist/strapi/providers/local-destination/index.js
- .../server/node_modules/@strapi/data-transfer/dist/strapi/providers/index.js
- .../server/node_modules/@strapi/data-transfer/dist/strapi/index.js
- .../server/node_modules/@strapi/data-transfer/dist/index.js
- .../server/node_modules/@strapi/strapi/dist/commands/index.js
- .../server/node_modules/@strapi/strapi/bin/strapi.js
    at loadJsFile (.../server/node_modules/@strapi/strapi/dist/core/app-configuration/load-config-file.js:21:19)
    at loadFile (.../server/node_modules/@strapi/strapi/dist/core/app-configuration/load-config-file.js:41:20)
    at Object.loadPlugins (.../server/node_modules/@strapi/strapi/dist/core/loaders/plugins/index.js:93:62)
    at async Strapi.loadPlugins (.../server/node_modules/@strapi/strapi/dist/Strapi.js:373:9)
    at async Promise.all (index 3)
    at async Strapi.register (.../server/node_modules/@strapi/strapi/dist/Strapi.js:407:9)
    at async Strapi.load (.../server/node_modules/@strapi/strapi/dist/Strapi.js:493:9)
    at async workerProcess (.../server/node_modules/@strapi/strapi/dist/commands/actions/develop/action.js:100:28)
    at async exports.default (.../server/node_modules/@strapi/strapi/dist/commands/actions/develop/action.js:38:20)

Steps to reproduce the behavior

  1. change package.json with the new version of strapi
  2. invoke npm install command
  3. invoke npm run build command
  4. invoke npm run develop command

Additional context

package.json

{
  "name": "server",
  "private": true,
  "version": "1.0.0",
  "description": "description",
  "scripts": {
    "develop": "strapi develop",
    "start": "strapi start",
    "build": "strapi build",
    "strapi": "strapi"
  },
  "dependencies": {
    "@strapi/plugin-i18n": "4.14.0",
    "@strapi/plugin-users-permissions": "4.14.0",
    "@strapi/provider-email-nodemailer": "^4.14.0",
    "@strapi/strapi": "4.14.0",
    "mysql2": "^3.6.1",
    "strapi-plugin-duplicate-button": "^1.1.13",
    "strapi-plugin-slugify": "^2.3.4"
  },
  "author": {
    "name": "a name"
  },
  "strapi": {
    "uuid": "xxx"
  },
  "engines": {
    "node": ">=14.19.1 <=18.x.x",
    "npm": ">=6.0.0"
  },
  "license": "license"
}

config/plugin.ts

//...

slugify: {
        enabled: true,
        config: {
            shouldUpdateSlug: true,
            contentTypes: {
                teacher: {
                    field: 'slug',
                    references: ['firstname', 'lastname'],
                },
                student: {
                    field: 'slug',
                    references: ['firstname', 'lastname', 'birthdate'],
                },
            },
        },
      },

//...

slugification: unique slug field respected

I have this plugin setup like so.

enabled: true,
    config: {
      contentTypes: {
        jam: {
          field: 'slug',
          references: 'title',
        }
      },
    },

I do not want the title field to be unique. But I do want the slug fields to be so when I generate the slug field using the strapi content type builder I check the unique field.

This is not respected when using this plugin and allows duplicate slugs to be generated.

In order to allow for this situation I would recommend the following:

If the field designated for the slug is flagged as unique provide a configuration option that allows the user to decide if a validation error should be thrown or if slugifyWithCounter() should be used .

slug as suggestion

I would like to give a suggested slug, but that user were able to change it at their own, so it would work only if slug field is empty ...

Unable to make it works

Hey,

Completly fresh new install of strapi in 4.6.0, then install slugify, then create a model "test" with two textfields, one named "title" other one named "slug".
When i create and publish a test, slug field is null.

Here is my config file :

module.exports = ({ env }) => ({
    slugify: {
      enabled: true,
      config: {
        contentTypes: {
            test: {
                field: 'slug',
                references: 'title',
            },
        },
        shouldUpdateSlug: true,
        slugifyWithCount: true,
        skipUndefinedReferences: true,
      },
    },
});

Have i done something wrong ?

Don't override slug if already set

If you already have published an article with a title and slug and you want to change the title afterwards, it would be very bad if the URL is changing too.

There should be a setting to disable that behavior.

feat: add locale param option for gql

When translating my categories, quite a few are the same across different languages.

Would it be possible to have an option to allow duplicated slugs and a "locale" option in the findSlug graphql method?

receiving error 403 when trying to find by slug

Hello, first of all thank you very much for this plugin.

I was starting a little project with nextjs and strapi 4.5.3 then i found this video where the dev is using exactly what i need (find an article by his slug)

But when i did all the configuration (in the plugins.js file and then in the strapi admin with the findOne option for the permissions section) i got a 403 error from the api

What i'm doing wrong? i followed all the steps from the video and the plugin configuration and right now i'm stuck

When I use I18N, how should I use Slugify

I have content type.

image

The slug filed must be unique.But in different language environments, some words are spelled the same.

For example, the spelling of English marketing is the same as that of German marketing. In this case, the slug should be the same, but the rules restrict that the slug can only be a unique value

When calling the `slugify/slug` endpoint with populate query values the data structure does not match the `findOne` endpoint.

If I pass 'populate' values into the query for relational values or component lists the values that come back do not have the same structure as the 'findOne' endpoint.

For example if I call `/api/:model/:id?populate[0]=owner I get the following structure

{
    "data": {
        "id": 45,
        "attributes": {
            "title": "Test Jam 1",
            "createdAt": "2022-02-28T21:26:16.504Z",
            "updatedAt": "2022-03-14T15:59:39.206Z",
            "publishedAt": "2022-02-28T21:26:16.478Z",
            "streamId": null,
            "status": null,
            "isPublic": false,
            "slug": "test-jam-1",
            "deletedOn": null,
            "deleted": false,
            "owner": {
                "data": {
                    "id": 1,
                    "attributes": {
                        "username": "selectedpixel",
                        "email": "[email protected]",
                        "provider": "local",
                        "confirmed": true,
                        "blocked": false,
                        "createdAt": "2022-02-03T11:12:57.855Z",
                        "updatedAt": "2022-02-08T13:53:28.715Z",
                        "country": null
                    }
                }
            }
        }
    },
    "meta": {}
}

If I make the same request using the slugify/slug endpoint I get the following:

{
    "data": {
        "id": 45,
        "attributes": {
            "title": "Test Jam 1",
            "createdAt": "2022-02-28T21:26:16.504Z",
            "updatedAt": "2022-03-14T15:59:39.206Z",
            "publishedAt": "2022-02-28T21:26:16.478Z",
            "streamId": null,
            "status": null,
            "isPublic": false,
            "slug": "test-jam-1",
            "deletedOn": null,
            "deleted": false,
            "owner": {
                "id": 1,
                "username": "selectedpixel",
                "email": "[email protected]",
                "provider": "local",
                "confirmed": true,
                "blocked": false,
                "createdAt": "2022-02-03T11:12:57.855Z",
                "updatedAt": "2022-02-08T13:53:28.715Z",
                "country": null
            }
        }
    },
    "meta": {}
}

Notice how the data and attributes fields are missing on the owner when using the slugify/slug endpoint?
This will cause the need to create a completely separate response models on the client side for this endpoint vs. the standard findOne endpoint.

Strapi 4.14.2 & GraphQL: Error Cannot read properties of undefined (reading 'admin::permission')

After running develop I get the following error:

info: [slugify] graphql detected, registering queries
TypeError: Cannot read properties of undefined (reading 'admin::permission')
   at /Users/kevin/Documents/strapi/node_modules/strapi-plugin-slugify/server/graphql/types.js:18:18
    at /Users/kevin/Documents/strapi/node_modules/lodash/lodash.js:4967:15
    at baseForOwn (/Users/kevin/Documents/strapi/node_modules/lodash/lodash.js:3032:24)
    at /Users/kevin/Documents/strapi/node_modules/lodash/lodash.js:4936:18
    at Function.forEach (/Users/kevin/Documents/strapi/node_modules/lodash/lodash.js:9410:14)
    at getCustomTypes (/Users/kevin/Documents/strapi/node_modules/strapi-plugin-slugify/server/graphql/types.js:17:4)
    at extension (/Users/kevin/Documents/strapi/node_modules/strapi-plugin-slugify/server/graphql/index.js:10:10)
    at resolveConfig (/Users/kevin/Documents/strapi/node_modules/@strapi/plugin-graphql/server/services/extension/extension.js:54:47)
    at /Users/kevin/Documents/strapi/node_modules/@strapi/plugin-graphql/server/services/extension/extension.js:60:11
    at Array.reduce (<anonymous>)
    at Object.generate (/Users/kevin/Documents/strapi/node_modules/@strapi/plugin-graphql/server/services/extension/extension.js:58:22)
    at buildMergedSchema (/Users/kevin/Documents/strapi/node_modules/@strapi/plugin-graphql/server/services/content-api/index.js:103:55)
    at Object.buildSchema (/Users/kevin/Documents/strapi/node_modules/@strapi/plugin-graphql/server/services/content-api/index.js:54:20)
    at Object.module.exports [as bootstrap] (/Users/kevin/Documents/strapi/node_modules/@strapi/plugin-graphql/server/bootstrap.js:38:66)
    at Object.bootstrap (/Users/kevin/Documents/strapi/node_modules/@strapi/strapi/dist/core/domain/module/index.js:42:53)
    at Object.bootstrap (/Users/kevin/Documents/strapi/node_modules/@strapi/strapi/dist/core/registries/modules.js:24:27)

Node: v16.20.1
NPM: 8.19.4
Strapi: 4.14.2

package.json:

{
  "name": "kevin-strapi",
  "private": true,
  "version": "0.1.0",
  "description": "",
  "scripts": {
    "develop": "strapi develop",
    "start": "strapi start",
    "build": "strapi build",
    "strapi": "strapi",
    "gcp-build": "strapi build"
  },
  "dependencies": {
    "@_sh/strapi-plugin-ckeditor": "^1.1.3",
    "@mui/x-date-pickers": "^5.0.20",
    "@offset-dev/strapi-calendar": "^0.0.9",
    "@retikolo/drag-drop-content-types": "^1.3.9",
    "@strapi-community/strapi-provider-upload-google-cloud-storage": "^4.10.5",
    "@strapi/plugin-graphql": "^4.14.2",
    "@strapi/plugin-i18n": "4.14.2",
    "@strapi/plugin-users-permissions": "4.14.2",
    "@strapi/strapi": "4.14.2",
    "better-sqlite3": "7.4.6",
    "pg": "^8.11.3",
    "strapi-google-auth": "^0.1.2",
    "strapi-plugin-config-sync": "^1.1.3",
    "strapi-plugin-duplicate-button": "^1.1.13",
    "strapi-plugin-import-export-entries": "^1.21.1",
    "strapi-plugin-publisher": "^1.4.1",
    "strapi-plugin-slugify": "^2.3.3"
  },
  "author": {
    "name": "Kevin Blanco"
  },
  "strapi": {
    "uuid": "852386d6-6f2a-4d8b-81d5-0dbd1e2f1b02"
  },
  "engines": {
    "node": "v16.20",
    "npm": "8.19"
  },
  "license": "MIT"
}

ALREADY TRIED:

Deleting .cache
Deleting npm_modules
Deleting yarn and package locks.
Use latest "strapi-plugin-slugify": "^2.3.5" same issue.

camelCasing becomes camel-casing

I am unsure if this is a bug or a feature or both, dependent upon ones relative spacetime needs.

The slugify option turns camelCasing into camel-casing lowercase with the hyphen for friendly URL's.

It took the title of a webpage called WebPage and split the title of the post into web-page and created unfriendly post search engine optimization.

Can't run develop after latest update (2.3.5) releashed

Hi,
I've provided some informations to see if that helps:

  • My Yarn Version: 1.22.19
  • Strapi Version: 4.13.7
  • Node Version: v18.18.0
  • Database: mysql (v8)

Here's some error report from console:

E:\Others\strapi\tutorial-strapi-with-nextjs> yarn develop
yarn run v1.22.19
$ strapi develop
Error: Could not load js config file E:\Others\strapi\tutorial-strapi-with-nextjs\node_modules\strapi-plugin-slugify\strapi-server.js: Cannot find module '@strapi/strapi/dist/core-api/controller/transform'
Require stack:
- E:\Others\strapi\tutorial-strapi-with-nextjs\node_modules\strapi-plugin-slugify\server\controllers\slug-controller.js
- E:\Others\strapi\tutorial-strapi-with-nextjs\node_modules\strapi-plugin-slugify\server\controllers\index.js
- E:\Others\strapi\tutorial-strapi-with-nextjs\node_modules\strapi-plugin-slugify\server\index.js
- E:\Others\strapi\tutorial-strapi-with-nextjs\node_modules\strapi-plugin-slugify\strapi-server.js
- E:\Others\strapi\tutorial-strapi-with-nextjs\node_modules\@strapi\utils\dist\import-default.js
- E:\Others\strapi\tutorial-strapi-with-nextjs\node_modules\@strapi\utils\dist\index.js
- E:\Others\strapi\tutorial-strapi-with-nextjs\node_modules\@strapi\strapi\lib\services\entity-service\components.js
- E:\Others\strapi\tutorial-strapi-with-nextjs\node_modules\@strapi\data-transfer\dist\strapi\queries\entity.js
- E:\Others\strapi\tutorial-strapi-with-nextjs\node_modules\@strapi\data-transfer\dist\strapi\queries\index.js
- E:\Others\strapi\tutorial-strapi-with-nextjs\node_modules\@strapi\data-transfer\dist\strapi\providers\local-destination\strategies\restore\index.js
- E:\Others\strapi\tutorial-strapi-with-nextjs\node_modules\@strapi\data-transfer\dist\strapi\providers\local-destination\strategies\index.js
- E:\Others\strapi\tutorial-strapi-with-nextjs\node_modules\@strapi\data-transfer\dist\strapi\providers\local-destination\index.js
- E:\Others\strapi\tutorial-strapi-with-nextjs\node_modules\@strapi\data-transfer\dist\strapi\providers\index.js
- E:\Others\strapi\tutorial-strapi-with-nextjs\node_modules\@strapi\data-transfer\dist\strapi\index.js
- E:\Others\strapi\tutorial-strapi-with-nextjs\node_modules\@strapi\data-transfer\dist\index.js
- E:\Others\strapi\tutorial-strapi-with-nextjs\node_modules\@strapi\strapi\lib\commands\utils\data-transfer.js
- E:\Others\strapi\tutorial-strapi-with-nextjs\node_modules\@strapi\strapi\lib\commands\actions\export\command.js
- E:\Others\strapi\tutorial-strapi-with-nextjs\node_modules\@strapi\strapi\lib\commands\index.js
- E:\Others\strapi\tutorial-strapi-with-nextjs\node_modules\@strapi\strapi\bin\strapi.js
    at loadJsFile (E:\Others\strapi\tutorial-strapi-with-nextjs\node_modules\@strapi\strapi\lib\core\app-configuration\load-config-file.js:18:11)
    at loadFile (E:\Others\strapi\tutorial-strapi-with-nextjs\node_modules\@strapi\strapi\lib\core\app-configuration\load-config-file.js:35:14)
    at Object.loadPlugins (E:\Others\strapi\tutorial-strapi-with-nextjs\node_modules\@strapi\strapi\lib\core\loaders\plugins\index.js:103:26)
    at async Strapi.loadPlugins (E:\Others\strapi\tutorial-strapi-with-nextjs\node_modules\@strapi\strapi\lib\Strapi.js:352:5)
    at async Promise.all (index 3)
    at async Strapi.register (E:\Others\strapi\tutorial-strapi-with-nextjs\node_modules\@strapi\strapi\lib\Strapi.js:392:5)
    at async Strapi.load (E:\Others\strapi\tutorial-strapi-with-nextjs\node_modules\@strapi\strapi\lib\Strapi.js:503:5)
    at async workerProcess (E:\Others\strapi\tutorial-strapi-with-nextjs\node_modules\@strapi\strapi\lib\commands\actions\develop\action.js:110:26)

And that's not all. I just saw our dev update to the latest version, but before that, my Strapi can't run slugify 2.3.4 as well either.
So let's see what happened last night:
I set up roles and tested json and they all working good, but when i enable slugify and try to get json, it throw the error:

    data: null,
    error: {
      status: 400,
      name: 'ValidationError',
      message: 'film model name not found, all models must be defined in the settings and are case sensitive.',
      details: {}
    }

I immediately checked this error from github and it seemed to come from a long time ago: This error seem the same as #75.

I also get lots of warning print in my console:

PS E:\Others\strapi\tutorial-strapi-with-nextjs> yarn add [email protected]
yarn add v1.22.19
[1/5] Validating package.json...
[2/5] Resolving packages...
Couldn't find any versions for "strapi-plugin-slugify" that matches "1.1.0"
? Please choose a version of "strapi-plugin-slugify" from this list: 2.3.4
[3/5] Fetching packages...
[4/5] Linking dependencies...
warning " > @strapi/[email protected]" has unmet peer dependency "react@^17.0.0 || ^18.0.0".
warning " > @strapi/[email protected]" has unmet peer dependency "react-dom@^17.0.0 || ^18.0.0".
warning " > @strapi/[email protected]" has unmet peer dependency "[email protected]".
warning " > @strapi/[email protected]" has unmet peer dependency "[email protected]".
warning "@strapi/plugin-i18n > @strapi/[email protected]" has unmet peer dependency "react@^17.0.0 || ^18.0.0".
warning "@strapi/plugin-i18n > @strapi/[email protected]" has unmet peer dependency "react-dom@^17.0.0 || ^18.0.0".
warning "@strapi/plugin-i18n > @strapi/[email protected]" has unmet peer dependency "react-router-dom@^5.2.0".
warning "@strapi/plugin-i18n > @strapi/[email protected]" has unmet peer dependency "styled-components@^5.2.1".
warning "@strapi/plugin-i18n > @strapi/[email protected]" has unmet peer dependency "react@^17.0.0 || ^18.0.0".
warning "@strapi/plugin-i18n > @strapi/[email protected]" has unmet peer dependency "react-dom@^17.0.0 || ^18.0.0".
warning "@strapi/plugin-i18n > @strapi/[email protected]" has unmet peer dependency "react-router-dom@^5.3.4".
warning "@strapi/plugin-i18n > @strapi/[email protected]" has unmet peer dependency "styled-components@^5.3.3".
warning "@strapi/plugin-i18n > @strapi/[email protected]" has unmet peer dependency "react@^17.0.0 || ^18.0.0".
warning "@strapi/plugin-i18n > @strapi/[email protected]" has unmet peer dependency "react-dom@^17.0.0 || ^18.0.0".
warning "@strapi/plugin-i18n > [email protected]" has unmet peer dependency "react@>=16.8.0".
warning "@strapi/plugin-i18n > [email protected]" has unmet peer dependency "react@^16.6.0 || 17 || 18".
warning "@strapi/plugin-i18n > [email protected]" has unmet peer dependency "react@^16.8.0 || ^17.0.0 || ^18.0.0".
warning "@strapi/plugin-i18n > [email protected]" has unmet peer dependency "react@^16.8 || ^17.0 || ^18.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @floating-ui/[email protected]" has unmet peer dependency "react@>=16.8.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @floating-ui/[email protected]" has unmet peer dependency "react-dom@>=16.8.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @radix-ui/[email protected]" has unmet peer dependency "react@^16.8 || ^17.0 || ^18.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @radix-ui/[email protected]" has unmet peer dependency "react-dom@^16.8 || ^17.0 || ^18.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @radix-ui/[email protected]" has unmet peer dependency "react@^16.8 || ^17.0 || ^18.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @radix-ui/[email protected]" has unmet peer dependency "react-dom@^16.8 || ^17.0 || ^18.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @radix-ui/[email protected]" has unmet peer dependency "react@^16.8 || ^17.0 || ^18.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @radix-ui/[email protected]" has unmet peer dependency "react-dom@^16.8 || ^17.0 || ^18.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @strapi/[email protected]" has unmet peer dependency "react@^17.0.0 || ^18.0.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @strapi/[email protected]" has unmet peer dependency "react-dom@^17.0.0 || ^18.0.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @uiw/[email protected]" has unmet peer dependency "@babel/runtime@>=7.11.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @uiw/[email protected]" has unmet peer dependency "@codemirror/state@>=6.0.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @uiw/[email protected]" has unmet peer dependency "@codemirror/theme-one-dark@>=6.0.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @uiw/[email protected]" has unmet peer dependency "@codemirror/view@>=6.0.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @uiw/[email protected]" has unmet peer dependency "codemirror@>=6.0.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @uiw/[email protected]" has unmet peer dependency "react@>=16.8.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @uiw/[email protected]" has unmet peer dependency "react-dom@>=16.8.0".
warning "@strapi/plugin-i18n > @strapi/design-system > [email protected]" has unmet peer dependency "react@^16.8.0 || ^17.0.0 || ^18.0.0".
warning "@strapi/plugin-i18n > @strapi/helper-plugin > [email protected]" has unmet peer dependency "react@>=16.3.0".
warning "@strapi/plugin-i18n > @strapi/helper-plugin > [email protected]" has unmet peer dependency "react@^16.8.0 || ^17.0.0 || ^18.0.0".
warning "@strapi/plugin-i18n > @strapi/helper-plugin > [email protected]" has unmet peer dependency "react-dom@^16.8.0 || ^17.0.0 || ^18.0.0".
warning "@strapi/plugin-i18n > react-redux > [email protected]" has unmet peer dependency "react@^16.8.0 || ^17.0.0 || ^18.0.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @radix-ui/react-dismissable-layer > @radix-ui/[email protected]" has unmet peer dependency "react@^16.8 || ^17.0 || ^18.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @radix-ui/react-dismissable-layer > @radix-ui/[email protected]" has unmet peer dependency "react@^16.8 || ^17.0 || ^18.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @radix-ui/react-dismissable-layer > @radix-ui/[email protected]" has unmet peer dependency "react-dom@^16.8 || ^17.0 || ^18.0".        
warning "@strapi/plugin-i18n > @strapi/design-system > @radix-ui/react-dismissable-layer > @radix-ui/[email protected]" has unmet peer dependency "react@^16.8 || ^17.0 || ^18.0".     
warning "@strapi/plugin-i18n > @strapi/design-system > @radix-ui/react-dismissable-layer > @radix-ui/[email protected]" has unmet peer dependency "react@^16.8 || ^17.0 || ^18.0".   
warning "@strapi/plugin-i18n > @strapi/design-system > @radix-ui/react-dropdown-menu > @radix-ui/[email protected]" has unmet peer dependency "react@^16.8 || ^17.0 || ^18.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @radix-ui/react-dropdown-menu > @radix-ui/[email protected]" has unmet peer dependency "react@^16.8 || ^17.0 || ^18.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @radix-ui/react-dropdown-menu > @radix-ui/[email protected]" has unmet peer dependency "react@^16.8 || ^17.0 || ^18.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @radix-ui/react-dropdown-menu > @radix-ui/[email protected]" has unmet peer dependency "react-dom@^16.8 || ^17.0 || ^18.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @radix-ui/react-dropdown-menu > @radix-ui/[email protected]" has unmet peer dependency "react@^16.8 || ^17.0 || ^18.0".   
warning "@strapi/plugin-i18n > @strapi/design-system > @strapi/ui-primitives > @radix-ui/[email protected]" has unmet peer dependency "react@^16.8 || ^17.0 || ^18.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @strapi/ui-primitives > @radix-ui/[email protected]" has unmet peer dependency "react-dom@^16.8 || ^17.0 || ^18.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @strapi/ui-primitives > @radix-ui/[email protected]" has unmet peer dependency "react@^16.8 || ^17.0 || ^18.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @strapi/ui-primitives > @radix-ui/[email protected]" has unmet peer dependency "react@^16.8 || ^17.0 || ^18.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @strapi/ui-primitives > @radix-ui/[email protected]" has unmet peer dependency "react@^16.8 || ^17.0 || ^18.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @strapi/ui-primitives > @radix-ui/[email protected]" has unmet peer dependency "react-dom@^16.8 || ^17.0 || ^18.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @strapi/ui-primitives > @radix-ui/[email protected]" has unmet peer dependency "react@^16.8 || ^17.0 || ^18.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @strapi/ui-primitives > @radix-ui/[email protected]" has unmet peer dependency "react-dom@^16.8 || ^17.0 || ^18.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @strapi/ui-primitives > @radix-ui/[email protected]" has unmet peer dependency "react@^16.8 || ^17.0 || ^18.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @strapi/ui-primitives > @radix-ui/[email protected]" has unmet peer dependency "react@^16.8 || ^17.0 || ^18.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @strapi/ui-primitives > @radix-ui/[email protected]" has unmet peer dependency "react@^16.8 || ^17.0 || ^18.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @strapi/ui-primitives > @radix-ui/[email protected]" has unmet peer dependency "react@^16.8 || ^17.0 || ^18.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @strapi/ui-primitives > @radix-ui/[email protected]" has unmet peer dependency "react-dom@^16.8 || ^17.0 || ^18.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @uiw/react-codemirror > @uiw/[email protected]" has unmet peer dependency "@codemirror/autocomplete@>=6.0.0".      
warning "@strapi/plugin-i18n > @strapi/design-system > @uiw/react-codemirror > @uiw/[email protected]" has unmet peer dependency "@codemirror/language@>=6.0.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @uiw/react-codemirror > @uiw/[email protected]" has unmet peer dependency "@codemirror/lint@>=6.0.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @uiw/react-codemirror > @uiw/[email protected]" has unmet peer dependency "@codemirror/search@>=6.0.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @uiw/react-codemirror > @uiw/[email protected]" has unmet peer dependency "@codemirror/view@>=6.0.0".
warning "@strapi/plugin-i18n > @strapi/design-system > react-remove-scroll > [email protected]" has unmet peer dependency "react@^16.8.0 || ^17.0.0 || ^18.0.0".
warning "@strapi/plugin-i18n > @strapi/design-system > react-remove-scroll > [email protected]" has unmet peer dependency "react@^16.8.0 || ^17.0.0 || ^18.0.0".
warning "@strapi/plugin-i18n > @strapi/design-system > react-remove-scroll > [email protected]" has unmet peer dependency "react@^16.8.0 || ^17.0.0 || ^18.0.0".
warning "@strapi/plugin-i18n > @strapi/design-system > react-remove-scroll > [email protected]" has unmet peer dependency "react@^16.8.0 || ^17.0.0 || ^18.0.0".
warning "@strapi/plugin-i18n > @strapi/helper-plugin > react-helmet > [email protected]" has unmet peer dependency "react@^16.3.0 || ^17.0.0 || ^18.0.0".
warning "@strapi/plugin-i18n > @strapi/helper-plugin > react-select > @emotion/[email protected]" has unmet peer dependency "react@>=16.8.0".
warning "@strapi/plugin-i18n > @strapi/helper-plugin > react-select > [email protected]" has unmet peer dependency "react@>=16.6.0".
warning "@strapi/plugin-i18n > @strapi/helper-plugin > react-select > [email protected]" has unmet peer dependency "react-dom@>=16.6.0".
warning "@strapi/plugin-i18n > @strapi/helper-plugin > react-select > [email protected]" has unmet peer dependency "react@^16.8.0 || ^17.0.0 || ^18.0.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @radix-ui/react-dropdown-menu > @radix-ui/react-menu > @radix-ui/[email protected]" has unmet peer dependency "react@^16.8 || ^17.0 || ^18.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @radix-ui/react-dropdown-menu > @radix-ui/react-menu > @radix-ui/[email protected]" has unmet peer dependency "react-dom@^16.8 || ^17.0 || ^18.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @radix-ui/react-dropdown-menu > @radix-ui/react-menu > @radix-ui/[email protected]" has unmet peer dependency "react@^16.8 || ^17.0 || ^18.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @radix-ui/react-dropdown-menu > @radix-ui/react-menu > @radix-ui/[email protected]" has unmet peer dependency "react-dom@^16.8 || ^17.0 
|| ^18.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @radix-ui/react-dropdown-menu > @radix-ui/react-menu > @radix-ui/[email protected]" has unmet peer dependency "react@^16.8 || ^17.0 
|| ^18.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @radix-ui/react-dropdown-menu > @radix-ui/react-menu > @radix-ui/[email protected]" has unmet peer dependency "react-dom@^16.8 || ^17.0 || ^18.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @radix-ui/react-dropdown-menu > @radix-ui/react-menu > [email protected]" has unmet peer dependency "react@^16.8.0 || ^17.0.0 || ^18.0.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @strapi/ui-primitives > @radix-ui/react-popper > @radix-ui/[email protected]" has unmet peer dependency "react@^16.8 || ^17.0 || ^18.0".   
warning "@strapi/plugin-i18n > @strapi/design-system > @strapi/ui-primitives > @radix-ui/react-popper > @radix-ui/[email protected]" has unmet peer dependency "react-dom@^16.8 || ^17.0 || ^18.0".
warning "@strapi/plugin-i18n > @strapi/design-system > @strapi/ui-primitives > @radix-ui/react-popper > @radix-ui/[email protected]" has unmet peer dependency "react@^16.8 || ^17.0 || ^18.0".warning "@strapi/plugin-i18n > @strapi/design-system > @strapi/ui-primitives > @radix-ui/react-popper > @radix-ui/[email protected]" has unmet peer dependency "react@^16.8 || ^17.0 || ^18.0".warning "@strapi/plugin-i18n > @strapi/design-system > @uiw/react-codemirror > @uiw/codemirror-extensions-basic-setup > @codemirror/[email protected]" has unmet peer dependency "@lezer/common@^1.0.0".
warning "@strapi/plugin-i18n > @strapi/helper-plugin > react-select > @emotion/react > @emotion/[email protected]" has unmet peer dependency "react@>=16.8.0".
warning " > @strapi/[email protected]" has unmet peer dependency "react@^17.0.0 || ^18.0.0".
warning " > @strapi/[email protected]" has unmet peer dependency "react-dom@^17.0.0 || ^18.0.0".
warning " > @strapi/[email protected]" has unmet peer dependency "[email protected]".
warning " > @strapi/[email protected]" has unmet peer dependency "[email protected]".
warning "@strapi/strapi > @strapi/[email protected]" has unmet peer dependency "react@^17.0.0 || ^18.0.0".
warning "@strapi/strapi > @strapi/[email protected]" has unmet peer dependency "react-dom@^17.0.0 || ^18.0.0".
warning "@strapi/strapi > @strapi/[email protected]" has unmet peer dependency "[email protected]".
warning "@strapi/strapi > @strapi/[email protected]" has unmet peer dependency "[email protected]".
warning "@strapi/strapi > @strapi/[email protected]" has unmet peer dependency "react@^17.0.0 || ^18.0.0".
warning "@strapi/strapi > @strapi/[email protected]" has unmet peer dependency "react-dom@^17.0.0 || ^18.0.0".
warning "@strapi/strapi > @strapi/[email protected]" has unmet peer dependency "[email protected]".
warning "@strapi/strapi > @strapi/[email protected]" has unmet peer dependency "[email protected]".
warning "@strapi/strapi > @strapi/[email protected]" has unmet peer dependency "react@^17.0.0 || ^18.0.0".
warning "@strapi/strapi > @strapi/[email protected]" has unmet peer dependency "react-dom@^17.0.0 || ^18.0.0".
warning "@strapi/strapi > @strapi/[email protected]" has unmet peer dependency "[email protected]".
warning "@strapi/strapi > @strapi/[email protected]" has unmet peer dependency "[email protected]".
warning "@strapi/strapi > @strapi/admin > styled-components > babel-plugin-styled-components > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning " > [email protected]" has unmet peer dependency "lodash@^4.17.21".
warning " > [email protected]" has unmet peer dependency "yup@^0.32.9".
[5/5] Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency.
info Direct dependencies
└─ [email protected]
info All dependencies
└─ [email protected]

I wonder why there are so many unmet peer dependencies, cuz i just created a new Strapi project at yesterday by using customzied settings: JS, Mysql, without eslint, And only one plugin slugify has been added.

And one of weird thing is, there are no plugins.js in the config folder, actually there's even no config folder.

Please check the files to get more informations:

strapi-plugin-slugify-2.3.4.zip
strapi-plugin-slugify-2.3.5(cant run develop).zip

Sqlite Error, Unique constraint failed slug

Hi,

Node 16.20
Strapi 4.12.5
better-sqlite3 8.5.0
strapipluginslugify 2.3.4

I am having an issue with the slug generation. When sending a request for creating a new event for an authenticated user, on the backend I am getting an sqlite error but the event gets created and slug generated in strapi. I've also tried different event-names but still getting this error.

{
  "data": {
    "name": "Tech Conference 2023",
    "performers": "Keynote Speaker: John Doe",
    "venue": "City Convention Center",
    "address": "456 Tech Street, Techville",
    "date": "2023-09-10",
    "time": "09:00 - 17:00",
    "description": "Join us at Tech Conference 2023, where industry experts and thought leaders will share insights on the latest trends in technology. The conference will cover topics such as AI, cybersecurity, blockchain, and more. Don't miss this opportunity to connect with fellow tech enthusiasts and gain valuable knowledge to drive innovation in your projects."
  }
}

[2023-08-25 11:14:39.528] error: insert into events (address, created_at, date, description, name, performers, published_at, slug, time, updated_at, venue) values ('456 Tech Street, Techville', '2023-08-25 11:14:39.522', '2023-09-10 00:00:00.000', 'Join us at Tech Conference 2023, where industry experts and thought leaders will share insights on the latest trends in technology. The conference will cover topics such as AI, cybersecurity, blockchain, and more. Don''t miss this opportunity to connect with fellow tech enthusiasts and gain valuable knowledge to drive innovation in your projects.', 'Tech Conference 2023', 'Keynote Speaker: John Doe', '2023-08-25 11:14:39.495', 'tech-conference-2023', '09:00 - 17:00', '2023-08-25 11:14:39.522', 'City Convention Center') returning id - UNIQUE constraint failed: events.slug

[FR] add relation reference type support

Hi.

No slug is generated for the relation fields.

Currently the plugin produces an object-object slug label for those types of fields.

Strapi: 4.11.4
Strapi Plugin Slugify: 2.3.3
MySQL: 8.0.30 (MySQL Community Server - GPL)

Can't get it working, slug Text field does not get set based on product name Text field

Can't get it working:

module.exports = ({ env }) => ({
	//
	slugify: {
		enabled: true,
		config: {
			contentTypes: {
				product: {
					field: 'slug',
					references: 'name',
				},
			},
			skipUndefinedReferences: true,
			shouldUpdateSlug: true,
		},
	},

Its installed, it says so in the Plugins list, and picking it up I can see this in console:

The server is restarting
[2023-04-26 15:41:08.255] info: [slugify] graphql detected, registering queries

Am using Strapi 4.7.0.

Slugify config on multiple table not generating findBySlug on Settings

Slugify config on multiple table not generating findBySlug on Settings. I already did npm run build but still not generating findBySlug

slugify: {
    enabled: true,
    config: {
      contentTypes: {
        product: {
          field: 'slug',
          references: 'name',
        },
        blog: {
          field: 'slug',
          references: 'title',
        },
      },
    },
  },

It is okay on product permission but i can't find findBySlug in blog permission settings
image
image

Update yup dependency to 1.1.1

The yup dependency is currently at version 0.32.x which is outdated.
It should normally be possible to update it to the latest version 1.1.1.

The reason is that it clashes with other strapi-plugins that use the major version 1.x.x .

[FR] add component reference type support

Hi.

No slug is generated for components.

I have analyzed the 'setting-service.js' file. I developed a possible fix that is working for me (see below).

With that fix, to produce the slug for the fields in a component, you have to set the plugin settings file field contentTypes using the value of the collectionName field used in the component configuration file.

Strapi: 4.11.4
Strapi Plugin Slugify: 2.3.3
MySQL: 8.0.30 (MySQL Community Server - GPL)

Here is a possible fix to generate a slug for components by changing the build method:

build(settings) {

	const buildModel = (contentType, uid, nameAttr,displayName) => {
		const model = settings.contentTypes[contentType[nameAttr]];
		if (!model) {
			return;
		}

		// ensure provided fields are present on the model
		const hasField = isValidModelField(contentType, model.field);
		if (!hasField) {
			strapi.log.warn(
				`[slugify] skipping ${contentType.info[displayName]} registration, invalid field provided.`
			);
			return;
		}

		let references = _.isArray(model.references) ? model.references : [model.references];
		const hasReferences = references.every((referenceField) =>
			isValidModelField(contentType, referenceField)
		);

		if (!hasReferences) {
			strapi.log.warn(
				`[slugify] skipping ${contentType.info[displayName]} registration, invalid reference field provided.`
			);
			return;
		}

		const data = {
			uid,
			...model,
			contentType,
			references,
		};
		settings.modelsByUID[uid] = data;
		settings.modelsByName[contentType[nameAttr]] = data;
	};

	// build models
	settings.modelsByUID = {};
	settings.modelsByName = {};
	
	_.each(strapi.contentTypes, (contentType, uid) => buildModel(contentType, uid, 'modelName', 'singularName'));
	_.each(strapi.components, (contentType, uid) => buildModel(contentType, uid, 'collectionName', 'displayName'));

	_.omit(settings, ['contentTypes']);

	return settings;
}
      

Bump Node Version to Match Strapi

Ran into an issue deploying my Strapi App with this plugin on Digital Ocean. The strapi node versions are >=18.0.0 <=20.x.x while strapi-plugin-slugify specifies >=14.19.1 <=18.x.x. This is set in the engine.node field of package.json.

Internal server error when requesting unpublished page

Whenever I use slugify to visit a published page, it retrieves the data without a problem. But, when I unpublish the page, it gives an Internal Server error when it should be a Not Found error.

This is an example accessing a unpublished page:
Screenshot 2022-03-15 at 09-11-44 Screenshot

This is an example accessing a published page:
Screenshot 2022-03-15 at 09-17-21 Screenshot

LOGs:
Captura de pantalla de 2022-03-15 09-19-29

Slugify version: 2.0.0
Strapi version: 4.1.2

article model name not found, all models must be defined in the settings and are case sensitive.

I've follow document and here is my config

slugify: {
       enabled: true,
       config: {
         contentTypes: {
           article: {
             field: 'slug',
             references: 'title',
           },
         },
       },
     },

and after I enter http://localhost:1337/api/slugify/slugs/artlcle/test

the error show up

"error": {
"status": 400,
"name": "ValidationError",
"message": "article model name not found, all models must be defined in the settings and are case sensitive.",
"details": {}
}

Here is my article schema.json

 "collectionName": "articles",
  "info": {
    "singularName": "article",
    "pluralName": "articles",
    "displayName": "Article",
    "description": ""
  }

where can I get right model name ?

feat: counter doesn't refresh during modification

Reproduce :

  • new entry with title "apple" => slug autogenerated as "apple"
  • modif title with "apples" => slug autogenerated as "apples"
  • modif title with "apple" => slug autogenerated as "apple-1"

However it's working if it's in a new entry

Can we slugify.refresh() to solve this pb ?

my config:

slugify: {
    enabled: true,
    config: {
      shouldUpdateSlug: true,
      slugifyWithCount: true,
      slugifyReset: true,
      contentTypes: {
        formation: {
          field: 'Url',
          references: 'Titre',
        },
      },
    },
  },

Skip generating slug if field is set

I'm looking for a way to prevent the plugin from generating a slug, if a user sets the field themselves.

We have a situation where the user may want to set the slug to something different for various reasons when creating an article, so the user edits the slug field, but when creating an item the plugin will not respect the data set in the slug field.

Is there a way to disable the plugin unless the slug field is empty?

Field does not auto generate

I am using a UUID because the text never worked automatically. The slug does not auto-generate to the name. It shows the name of the content type. Am I missing something with the plugin?

These are my settings :
slugify: { enabled: true, config: { contentTypes: { service: { field: "slug", references: "name", }, }, },

[enhancement] Compound slug

Add an option in the plugin config where you could add fields to put togheter for a slug.
Maybe an array with fieldnames. The order of they are in the array should be how the compund slug is made.

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.