- last update
over 1 year ago Patch Failed to Apply - 🇸🇮Slovenia primsi
Here is an inital patch based on the SanitizeUserFieldsCommands.
- last update
over 1 year ago 23 pass - 🇸🇮Slovenia primsi
Patch had no content ... probably wrong git diff > ... Fixing.
- Status changed to Needs work
over 1 year ago 10:18am 20 September 2023 - 🇨🇭Switzerland berdir Switzerland
-
+++ b/src/Commands/SanitizeProfileFieldsCommands.php @@ -0,0 +1,166 @@ + foreach ($profile_types as $profile_type) {
looping over profile types is problematic needed, you'd update the same tables multiple times if they are shared. I see you need it for the default value, that's unfortunate.
a reason to do that would be to support specific bundle include/exclude (possibly later), but then you need to add a bundle condition to the query.
or we do a separate loop first to build default values and only process bundle fields once, by tracking values[$field_name] and if it's already set or not.
-
+++ b/src/Commands/SanitizeProfileFieldsCommands.php @@ -0,0 +1,166 @@ + $table = 'profile__' . $key;
this is copied, but it should really use the api to get the field name. Long field names can result in a hashed table names and then this will fail.
Also, we need to do revision tables as well.
You want to get the table mapping:
$table_mapping = \Drupal::entityTypeManager()
->getStorage($entity_type_id)
->getTableMapping();And then use getDedicatedDataTableName() and getDedicatedRevisionTableName(). They are not on the default interface, so you want to do an instanceof check for the specific class and skip if that's not it.
-
- Status changed to Needs review
over 1 year ago 3:13pm 20 September 2023 - last update
over 1 year ago 23 pass - last update
over 1 year ago 23 pass - 🇸🇮Slovenia primsi
Execution mistakenly left out after that bit of refactoring.
- last update
about 1 year ago 23 pass - 🇸🇮Slovenia primsi
Adding an option to truncate value length (not sure about the naming). If a profile uses separate fields for let's say name and surname, this can result in quite long first names and last names.
- last update
about 1 year ago 23 pass - last update
12 months ago 23 pass