You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We've got a headless, multi-site install, with two sites (sites A and B) and a section that has the "Let each entry choose..." propagation setting. This section has one custom preview target, with a {canonicalUid} token in its URL format.
After adding a new site B version for an existing entry in site A (via the "Add a site.." button), if the author switches to that new site entry without first re-saving/applying changes for the existing entry, an exception Attempt to read property "uid" on bool is thrown:
The site B version remains inaccessible due to this error, until the original site A entry is manually re-saved.
As evident from the stack trace, the culprit seems to be the use of canonicalUid in the section's preview target URL. Indeed, if we remove canonicalUid from the preview target URL, the exception goes away.
Steps to reproduce
Create two sites, and a section enabled for both of them, with the "Let each entry choose..." propagation setting
Add a preview target to the section, that includes a canonicalUid token (e.g. something like https://awesome-web-app.io/entry/{canonicalUid}
Create an entry in the section, and save/publish it.
Click the "Add a site..." button, and create a site version for the second site.
Without manually re-saving the current entry (i.e. it should now display "Showing your unsaved changes"), switch to the newly created site version via the site/revision dropdown at the top of the page.
Expected behavior
It should be possible to use canonicalUid in preview target URLs without having to manually re-save/apply changes to existing entries, after adding new site entries.
Actual behavior
Exception is thrown :(
Craft CMS version
4.3.1 PRO
PHP version
8.1.11
Operating system and version
macOS 12.6
Database type and version
10.8.3-MariaDB
Image driver and version
No response
Installed plugins and versions
None
The text was updated successfully, but these errors were encountered:
What happened?
Description
We've got a headless, multi-site install, with two sites (sites A and B) and a section that has the "Let each entry choose..." propagation setting. This section has one custom preview target, with a
{canonicalUid}
token in its URL format.After adding a new site B version for an existing entry in site A (via the "Add a site.." button), if the author switches to that new site entry without first re-saving/applying changes for the existing entry, an exception
Attempt to read property "uid" on bool
is thrown:Full stack trace is here.
The site B version remains inaccessible due to this error, until the original site A entry is manually re-saved.
As evident from the stack trace, the culprit seems to be the use of
canonicalUid
in the section's preview target URL. Indeed, if we removecanonicalUid
from the preview target URL, the exception goes away.Steps to reproduce
canonicalUid
token (e.g. something likehttps://awesome-web-app.io/entry/{canonicalUid}
Expected behavior
It should be possible to use
canonicalUid
in preview target URLs without having to manually re-save/apply changes to existing entries, after adding new site entries.Actual behavior
Exception is thrown :(
Craft CMS version
4.3.1 PRO
PHP version
8.1.11
Operating system and version
macOS 12.6
Database type and version
10.8.3-MariaDB
Image driver and version
No response
Installed plugins and versions
None
The text was updated successfully, but these errors were encountered: