File tree Expand file tree Collapse file tree 2 files changed +25
-4
lines changed Expand file tree Collapse file tree 2 files changed +25
-4
lines changed Original file line number Diff line number Diff line change @@ -31,10 +31,6 @@ public static function makeModelFromContract(Contract $source)
3131
3232 $ data = $ source ->data ();
3333
34- if ($ source ->hasOrigin ()) {
35- $ data = $ source ->origin ()->data ()->merge ($ data );
36- }
37-
3834 return $ class ::firstOrNew ([
3935 'handle ' => $ source ->globalSet ()->handle (),
4036 'locale ' => $ source ->locale ,
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Globals ;
4+
5+ use PHPUnit \Framework \Attributes \Test ;
6+ use Statamic \Eloquent \Globals \VariablesModel ;
7+ use Statamic \Facades ;
8+ use Tests \TestCase ;
9+
10+ class GlobalVariablesTest extends TestCase
11+ {
12+ #[Test]
13+ public function does_not_save_synced_origin_data_to_localizations ()
14+ {
15+ $ global = Facades \Globalset::make ('test ' );
16+
17+ $ global ->addLocalization ($ global ->makeLocalization ('en ' )->data (['foo ' => 'bar ' , 'baz ' => 'qux ' ]));
18+ $ global ->addLocalization ($ global ->makeLocalization ('fr ' )->origin ('en ' )->data ([]));
19+
20+ $ global ->save ();
21+
22+ $ this ->assertCount (2 , VariablesModel::all ());
23+ $ this ->assertSame (VariablesModel::all ()->firstWhere ('locale ' , 'fr ' )->data , []);
24+ }
25+ }
You can’t perform that action at this time.
0 commit comments