Closed mike99christie closed 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
- dd5d0c8 https://github.com/u3a-siteworks-development/u3a-siteworks-core/pull/110/commits/dd5d0c87c80c262f6b6ee7583991b7ec3a8fc3f4 add back older versions of status and cat
- d4dfe5c https://github.com/u3a-siteworks-development/u3a-siteworks-core/pull/110/commits/d4dfe5c3a5500a0180e348b1b33c9779cd2c2552 correct defaults
- 203924c https://github.com/u3a-siteworks-development/u3a-siteworks-core/pull/110/commits/203924c440bebb2facb381da64acc42be4fee991 revise group_status and group_cat backwards compatibility
- af74d30 https://github.com/u3a-siteworks-development/u3a-siteworks-core/pull/110/commits/af74d3059aae71f7ac60543bf481e9bd0c96bdf3 revise event_cat backwards compatibilty
- 185d709 https://github.com/u3a-siteworks-development/u3a-siteworks-core/pull/110/commits/185d7096c07241d16b4748d7b7ecf979b09bf903 remove unneeded code
File Changes
(3 files https://github.com/u3a-siteworks-development/u3a-siteworks-core/pull/110/files )
- M classes/class-u3a-event.php https://github.com/u3a-siteworks-development/u3a-siteworks-core/pull/110/files#diff-602a16724d342ba92caf321f30c13940507f9805c5f5ad1dbeb8e00f33327237 (10)
- M classes/class-u3a-group.php https://github.com/u3a-siteworks-development/u3a-siteworks-core/pull/110/files#diff-e6e087d42b5a564ef9ce1a557605012a1537a36267ed2929c2538228248f439c (36)
- M js/u3a-group-blocks.js https://github.com/u3a-siteworks-development/u3a-siteworks-core/pull/110/files#diff-341c938acf88ce155871603be5c465d13aff57f54d758e673cc5e326334a4c7e (9)
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: @.***>
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...
See email which details my latest test findings.
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