Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.x]: Revision Notes not working #12641

Closed
olsp opened this issue Feb 7, 2023 · 12 comments · Fixed by #12661
Closed

[4.x]: Revision Notes not working #12641

olsp opened this issue Feb 7, 2023 · 12 comments · Fixed by #12661
Assignees

Comments

@olsp
Copy link

olsp commented Feb 7, 2023

What happened?

I tried to use the revision notes for entries but everytime I change field value, write something in the revision note field and save, the text in the revision notes are gone.

In my template I already prepared the code to display the notes on the frontend like this {{ entry.revisionNotes }}, but then I get an error: "Invalid Call – yii\base\InvalidCallException Getting write-only property: craft\elements\Entry::revisionNotes"

Are the revision notes not meant to be used like this?

Craft CMS version

4.3.6.1

PHP version

8.0.14

@brianjhanson brianjhanson self-assigned this Feb 7, 2023
@brianjhanson
Copy link
Contributor

Thanks for reporting! At the moment revisionNotes are protected which means you can't access them with other entry properties. We may end up making those more public (potentially in the process of implementing #12610). If you need to get at them in the meantime, you are able to access them the same way we do for the entry table.

{% set revision = entry.currentRevision %}  
{% if revision %}  
    {% set behavior = revision.getBehavior('revision') %}  
    {% if behavior %}  
        {{ behavior.revisionNotes }}  
    {% endif %}  
{% endif %}

@brandonkelly
Copy link
Member

I tried to use the revision notes for entries but everytime I change field value, write something in the revision note field and save, the text in the revision notes are gone.

This should be fixed now, in Craft 4.3.8. Revision notes that were set on the input weren’t being retained when you reloaded the entry edit page.

@olsp
Copy link
Author

olsp commented Feb 8, 2023

Thanks for looking into this. I updated to 4.3.8 and now the revision notes are saved while an entry is a draft but as soon as I save the entry, the revision notes are gone. When writing a new revision note for a published entry, they disappear as soon as I save the entry.

@brandonkelly
Copy link
Member

The current revision’s notes should show up within the meta info, below the editable note input:

Screenshot of entry metadata

@olsp
Copy link
Author

olsp commented Feb 8, 2023

Am I doing something wrong? They don't show up for me.
revision-notes

@brianjhanson
Copy link
Contributor

brianjhanson commented Feb 8, 2023

Very odd. I'm not seeing the same behavior on a clean install. Is there anything in storage/logs that might provide a clue? Or do you have any non-default configuration settings set?

@brandonkelly
Copy link
Member

@olsp Does your section have versioning enabled?

@olsp
Copy link
Author

olsp commented Feb 9, 2023

Yes, I do see versions. I just created a new version with a revision note. When I switch to the previous version, I do see the "old" revision note. So it seems like the only the current revision note isn't visible.

@olsp
Copy link
Author

olsp commented Feb 9, 2023

@brianjhanson here is what I have added to the config:

'limitAutoSlugsToAscii' => true,
'convertFilenamesToAscii' => true,
'maxUploadFileSize' => 335544320,
'maxRevisions' => 0,
'sendPoweredByHeader' => false,
'postLoginRedirect' => 'dashboard',
'setPasswordRequestPath' => 'reset-password'

I don't really know what to look for in the logs. Do you have a hint what to look into?

@brianjhanson
Copy link
Contributor

Can you send over a database dump, composer.lock and composer.json files to [email protected], and we can dig in a bit more?

@brandonkelly
Copy link
Member

All fixed for the next Craft 3 and 4 releases, via #12661. Thanks for bearing with us @olsp!

@brandonkelly
Copy link
Member

Craft 3.7.66 and 4.3.9 are out with that fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants