Description
When using the plugin/preview-button/before-build-url hook in version 2.2.2 of strapi-plugin-preview-button, the uid parameter is not being passed to the hook callback function as expected.
Expected Behavior
According to documentation and release notes, the hook should receive an object with these parameters:
app.registerHook('plugin/preview-button/before-build-url', ({ data, draft, published, uid }) => {
// uid should be available here
});
Actual Behavior
When logging the object passed to the hook and its keys:
console.log('before-build-url', object, Object.keys(object));
Only draft, data, and published are present in the object. The uid key is missing, making it impossible to do conditional operations based on content type:
// Console output shows:
["draft", "data", "published"]
Environment
- Strapi version: 4.25.22
- strapi-plugin-preview-button: 2.2.2
- Node.js version:v20.18.2
Reproduction Steps
- Add a custom plugin that registers the
plugin/preview-button/before-build-url hook
- Log the object and its keys in the hook callback
- Observe that
uid is missing from the object
Impact
This issue makes it impossible to implement different URL-building logic for different content types, which is a key use case mentioned in the documentation.
Description
When using the
plugin/preview-button/before-build-urlhook in version 2.2.2 of strapi-plugin-preview-button, theuidparameter is not being passed to the hook callback function as expected.Expected Behavior
According to documentation and release notes, the hook should receive an object with these parameters:
Actual Behavior
When logging the object passed to the hook and its keys:
Only
draft,data, andpublishedare present in the object. Theuidkey is missing, making it impossible to do conditional operations based on content type:Environment
Reproduction Steps
plugin/preview-button/before-build-urlhookuidis missing from the objectImpact
This issue makes it impossible to implement different URL-building logic for different content types, which is a key use case mentioned in the documentation.