- Issue created by @tedbow
- πΊπΈUnited States tedbow Ithaca, NY, USA
Add a item to the summary that we need to account for default values of XB fields
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Crediting myself for that proposed solution. I wrote that at https://git.drupalcode.org/project/experience_builder/-/merge_requests/2....
- Assigned to tedbow
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Wonderful to have you working on this, @tedbow! You'll be the first one to start using https://mariadb.com/docs/skysql-dbaas/ref/xpand/functions/JSON_EXTRACT/ and other JSON functions in the database π
- πΊπΈUnited States tedbow Ithaca, NY, USA
@Wim Leers well that should be interesting!
I have rough version of finding use of a field if it is in the default value of a field. Next I will work on the actual querying of the column values
- Status changed to Needs work
6 months ago 8:28pm 31 May 2024 - Status changed to Active
6 months ago 1:37pm 2 June 2024 - Status changed to Needs work
6 months ago 2:24am 3 June 2024 - πΊπΈUnited States tedbow Ithaca, NY, USA
Ok was able to find matches using
json_extract()
but the wildcard key matching works in MariaDB but not SqliteDidn't mean to bump it down from critical before
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
#12: Why is that? https://sqlite.org/json1.html#jex says this should work? I'll get SQLite testing goingβ¦
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
FYI: working to preemptively unblock this issue by ensuring XB is being tested against new enough SQLite version: π PHPUnit SQLite CI job Needs review .
- Status changed to Postponed
6 months ago 8:15am 3 June 2024 - Status changed to Needs work
6 months ago 9:39am 3 June 2024 - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
π PHPUnit SQLite CI job Needs review landed. That should allow us to prove or disprove #12, and once this is merged, we'll have the confidence that it won't break.
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
BTW, for conditionally skipping tests depending on the active DB (and hence depending on CI job), see
\Drupal\KernelTests\Core\Database\DriverSpecificKernelTestBase::setUp()
for inspiration. - π¬π§United Kingdom catch
Adding a reference to β¨ JSON-based data storage proposal for component-based page building Active so it's easier to find in both directions.
- Assigned to wim leers
- Status changed to Needs review
5 months ago 7:04pm 5 June 2024 - π¬π§United Kingdom catch
This doesn't help us if someone deletes a field - it is only addressing uninstalling a module.
I'm a bit confused by this. Which I could possibly answer by reading the code base more, but also feels a bit conceptual so being lazy instead.
My understanding of the current approach is:
1. There is a 'xb json field' which holds all the data relevant to XB.
2. This 'xb json field' holds components and props etc. which are based on 'field types'.
3. However, the different field types that are used in the 'xb json field' don't have any kind of representation as field.storage.* field.field.* config entities assigned to the entity bundle, they are are instead dynamically used based on the components available.
If #3 is correct, then there is no such thing as 'deleting a field' with this data model, because there is no field (in the current entity bundle + fields sense) to delete.
If #3 is wrong, and we have to create field.storage.* and field.field.* config entities for each bundle that's using components in xb that need those field types, then the very existence of those fields should prevent uninstall (because they will impact the components available to use), not whether they have content.
If whatever provides the components/props has an explicit dependency on the field types, then it also feels like we could use that. i.e. an image component with an image widget/formatter using the image field type being available on a bundle should prevent uninstall of the image module. To uninstall image module, you'd need to remove that component, and then removing the component would depend on whether there's any content using it.
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
@catch it's not fields, it's references in the tree to values in other fields
Eg a hero title component might reference a hero image field and title field in a node. At present if the hero image field is deleted it fatals
The intent is that some components store arbitrary data but some are backed by structured fields. The intention is this will allow editing the field values and the 'layout' in one place
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
In terms of the why, a hero image is a good example - you could imagine this would be used in the full page view but also in a card view mode for a node
Having some structured data at the entity level allows for reuse
- π¬π§United Kingdom catch
Eg a hero title component might reference a hero image field and title field in a node. At present if the hero image field is deleted it fatals
If the 'hero title component' is enabled for an entity bundle, that would also break if the field is deleted, so shouldn't we be preventing deletion of the field while the component is enabled, AND also prevent deletion of the component if it's used in any content?
- πΊπΈUnited States tedbow Ithaca, NY, USA
@catch @larowlan sorry we really to document better how this works
for now I have created π Prevent fields from being deleted if they are used in Experience Builder field's dynamic prop values Active because the "props" in XB field could dynamically reference an actual field of a entity being displayed. In which case we would want to prevent the field on the bundle from being deleted
This current issue deals with a static field where it basically just uses the "shape" of a field type and stores the values in the props too(what we are calling "static"). In this case the values for the field props would be stored in the "props" column of the XB field
-
Wim Leers β
committed 4de875ca on sdc_prop_choices
Remove addition by @larowlan β it is up to #3450957 + #3452848 to preven...
-
Wim Leers β
committed 4de875ca on sdc_prop_choices
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Merged in upstream changes + resolved conflicts after β¨ [MR Only] Edit any component prop, powered by a new FieldForComponentSuggester service, which will power the JS UI Fixed landed.
- Issue was unassigned.
- Status changed to RTBC
5 months ago 6:55pm 7 June 2024 -
Wim Leers β
committed 8888c2eb on 0.x authored by
tedbow β
Issue #3450957 by tedbow, Wim Leers, catch, larowlan: Prevent modules...
-
Wim Leers β
committed 8888c2eb on 0.x authored by
tedbow β
- Status changed to Fixed
5 months ago 6:59pm 7 June 2024 Automatically closed - issue fixed for 2 weeks with no activity.