File tree 2 files changed +14
-6
lines changed
2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change 1
- ## 5.0.0 - 2024-03-01
1
+ ## 5.0.0-rc2 - 2024-04-29
2
+ ### Fixed
3
+ - Fix element validation issue when saving (Fixes #478 )
4
+
5
+ ## 5.0.0-rc1 - 2024-03-01
2
6
### Changed
3
7
- Add support for Craft 5
4
8
Original file line number Diff line number Diff line change @@ -452,20 +452,24 @@ private function _getVariables ()
452
452
453
453
if ($ this ->_element !== null )
454
454
{
455
- foreach (array_keys ($ this ->_element ->fields ()) as $ name )
455
+ foreach ($ this ->_element ->getFieldLayout ()->getCustomFields () as $ field ) {
456
+ $ name = $ field ->handle ;
457
+
456
458
if ($ name !== $ this ->_handle )
457
459
$ variables [$ name ] = $ this ->_element ->$ name ?? null ;
460
+ }
458
461
459
462
if (!array_key_exists ('type ' , $ variables ) && $ this ->_element ->hasMethod ('getType ' ))
460
463
$ variables ['type ' ] = $ this ->_element ->getType ();
461
464
462
465
if (!array_key_exists ('section ' , $ variables ) && $ this ->_element ->hasMethod ('getSection ' ))
463
466
$ variables ['section ' ] = $ this ->_element ->getSection ();
464
467
465
- $ variables = array_merge (
466
- $ variables ,
467
- $ this ->_element ->toArray ($ this ->_element ->extraFields (), [], false )
468
- );
468
+ if (!array_key_exists ('site ' , $ variables ) && $ this ->_element ->hasMethod ('getSite ' ))
469
+ $ variables ['site ' ] = $ this ->_element ->getSite ();
470
+
471
+ if (!array_key_exists ('author ' , $ variables ) && $ this ->_element ->hasMethod ('getAuthor ' ))
472
+ $ variables ['author ' ] = $ this ->_element ->getAuthor ();
469
473
}
470
474
471
475
return $ variables ;
You can’t perform that action at this time.
0 commit comments