notum-cz / strapi-plugin-record-locking

This plugin provides the functionality to prevent data loss in cases where multiple users are simultaneously editing the same record within STRAPI v4.
20 stars 8 forks source link

Having plugin installed breaks `npm run strapi report` #83

Closed broksonic21 closed 5 months ago

broksonic21 commented 7 months ago

Example results here:

> strapi report

Launched In: 859 ms
Environment: development
OS: darwin-arm64
Strapi Version: 4.22.0
Node/Yarn Version: npm/10.5.1 node/v20.12.1 darwin arm64 workspaces/false
Edition: Community
Database: mysql2
TypeError: Cannot read properties of undefined (reading 'query')
    at module.exports [as destroy] (/Users/REDACTED/REDACTED/REDACTED/node_modules/@notum-cz/strapi-plugin-record-locking/server/destroy.js:7:13)
    at Object.destroy (/Users/REDACTED/REDACTED/REDACTED/node_modules/@strapi/strapi/dist/core/domain/module/index.js:53:45)
    at Object.destroy (/Users/REDACTED/REDACTED/REDACTED/node_modules/@strapi/strapi/dist/core/registries/modules.js:33:19)
    at async Strapi.runLifecyclesFunctions (/Users/REDACTED/REDACTED/REDACTED/node_modules/@strapi/strapi/dist/Strapi.js:440:5)
    at async Strapi.destroy (/Users/REDACTED/REDACTED/REDACTED/node_modules/@strapi/strapi/dist/Strapi.js:226:5)
    at async action (/Users/REDACTED/REDACTED/REDACTED/node_modules/@strapi/strapi/dist/commands/actions/report/action.js:26:3)
broksonic21 commented 6 months ago

@omikulcik @martincapek i see you listed as maintainer and main star. Any way to get this in on a release?

omikulcik commented 5 months ago

Thank you for reporting this. I have fixed this by adding optional chaining in https://github.com/notum-cz/strapi-plugin-record-locking/commit/afd8b915d10b7da9b93290c59bf4cfd9c1d71b04 and will release new version.

broksonic21 commented 5 months ago

Thanks @omikulcik - confirmed this works on the new release!