Skip to content

Commit

Permalink
Merge branch '4.13' into 4
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Oct 9, 2023
2 parents 31d3309 + 00778d0 commit 64a085e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,16 @@ A couple things to note here:

* By assigning a value of `true` to the field, we defer to the model to infer the type for the field. To override that, we can always add a `type` property:

```yaml
MyProject\Models\Product:
fields:
onSale:
type: Boolean
```
```yaml
MyProject\Models\Product:
fields:
onSale:
type: Boolean
```

* The mapping of our field names to the `DataObject` property is case-insensitive. It is a
convention in GraphQL APIs to use lowerCamelCase fields, so this is given by default.

[/notice]

### Bulk loading models
Expand All @@ -239,9 +240,9 @@ elemental: # An arbitrary key to define what these directives are doing
load:
inheritanceLoader:
include:
- DNADesign\Elemental\Models\BaseElement
- DNADesign\Elemental\Models\BaseElement
exclude:
- MyApp\Elements\MySecretElement
- MyApp\Elements\MySecretElement
# Add all fields and read operations
apply:
fields:
Expand Down
14 changes: 7 additions & 7 deletions en/03_Upgrading/07_Upgrading_Fluent.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,14 @@ The following actions in the history tab in the CMS are affected:

### Standard Versioned methods

Fluent 6 alters how many of the [`Versioned`](api:SilverStripe/Versioned/Versioned) methods work as the data source is changed to use the localised tables. This has a large impact on the CMS UI and behaviour (as mentioned in the previous section).
Fluent 6 alters how many of the [`Versioned`](api:SilverStripe\Versioned\Versioned) methods work as the data source is changed to use the localised tables. This has a large impact on the CMS UI and behaviour (as mentioned in the previous section).

Examples of impacted methods:

- [`isOnDraft()`](api:SilverStripe/Versioned/Versioned::isOnDraft())
- [`isPublished()`](api:SilverStripe/Versioned/Versioned::isPublished())
- [`isArchived()`](api:SilverStripe/Versioned/Versioned::isArchived())
- [`stagesDiffer()`](api:SilverStripe/Versioned/Versioned::stagesDiffer())
- [`isOnDraft()`](api:SilverStripe\Versioned\Versioned::isOnDraft())
- [`isPublished()`](api:SilverStripe\Versioned\Versioned::isPublished())
- [`isArchived()`](api:SilverStripe\Versioned\Versioned::isArchived())
- [`stagesDiffer()`](api:SilverStripe\Versioned\Versioned::stagesDiffer())

Simply put, any code you have checking the versioned state of a record used to return results for the base (unlocalised) record. To get the result for the localised record, specialised methods had to be called.

Expand Down Expand Up @@ -243,9 +243,9 @@ These changes aren't likely to break anything in your project, but we recommend
Some unit tests may break. There's no one solution for problems you may encounter, but some general recommendations that might help are:

- avoid localised tables in yaml fixtures
- localise models in your PHP code instead, either in the `setUp()` method or via ORM calls (for example explicitly calling [`$obj->write()`](api:SilverStripe/ORM/DataObject::write()) after fetching the fixture object)
- localise models in your PHP code instead, either in the `setUp()` method or via ORM calls (for example explicitly calling [`$obj->write()`](api:SilverStripe\ORM\DataObject::write()) after fetching the fixture object)
- avoid including version history in your yaml fixtures
- use ORM methods like [`$obj->publishRecursive()`](api:SilverStripe/Versioned/RecursivePublishable:publishRecursive()) after fetching the fixture objects instead
- use ORM methods like [`$obj->publishRecursive()`](api:SilverStripe\Versioned\RecursivePublishable:publishRecursive()) after fetching the fixture objects instead

## Further reading

Expand Down

0 comments on commit 64a085e

Please sign in to comment.