u3a-siteworks-development / u3a-siteworks-core

The core plugins
GNU General Public License v2.0
2 stars 0 forks source link

Backwards compatibility changes #110

Closed mike99christie closed 2 months ago

mike99christie commented 3 months ago

If the old parameter (status or cat) has a non default value, we use it. Otherwise we use the new parameter (group_status, group_cat of event_cat). This works as if both old an new are their default values it is ok and if the new parameter is not default it must have been set deliberately. All this code is executed immediately after the $display_args array has been set up.

I hope this is clear and correct!! Mike

edwery commented 3 months ago

I dont think we should use the old value at all if the new value exists. Suppose I edit a block with the existing 'cat' value set to non default, and choose to set it true. I have then set 'group_cat' to 'y', but cat remains 'n'. When the block displays it should take 'group_cat' but if you use 'cat'it will still show 'n'.

Ed.

On Thu, Aug 8, 2024 at 5:09 PM Mike Christie @.***> wrote:

If the old parameter (status or cat) has a non default value, we use it. Otherwise we use the new parameter (group_status, group_cat of event_cat). This works as if both old an new are their default values it is ok and if the new parameter is not default it must have been set deliberately. All this code is executed immediately after the $display_args array has been set up.

I hope this is clear and correct!! Mike

You can view, comment on, or merge this pull request online at:

https://github.com/u3a-siteworks-development/u3a-siteworks-core/pull/110 Commit Summary

File Changes

(3 files https://github.com/u3a-siteworks-development/u3a-siteworks-core/pull/110/files )

Patch Links:

- https://github.com/u3a-siteworks-development/u3a-siteworks-core/pull/110.patch

https://github.com/u3a-siteworks-development/u3a-siteworks-core/pull/110.diff

— Reply to this email directly, view it on GitHub https://github.com/u3a-siteworks-development/u3a-siteworks-core/pull/110, or unsubscribe https://github.com/notifications/unsubscribe-auth/A62JSON4ENASUFOJWRNAB63ZQOJZ7AVCNFSM6AAAAABMGZYFW2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGQ2TMMJWHA2TSOI . You are receiving this because your review was requested.Message ID: @.***>

mike99christie commented 3 months ago

I don't think that is possible as if 'group_cat' is set to a non default value, that must have been done in the block editor and then the block will not return 'cat' as an attribute. The only way that 'cat' can be set to a NON_DEFAULT value is if it is in the <!-- wp:u3a/grouplist ... /> and this can only happen if the grouplist block has not been edited with the new version of the js editor. The problem with saying "if the new value exists" is that the code as written doesn't distinguish between explictly setting a value to the default and simply having the default value on initialisation. BTW I have got to make changes to correct missing semicolons...

mike99christie commented 3 months ago

See email which details my latest test findings.