Account created on 28 July 2005, over 19 years ago
#

Recent comments

🇳🇿New Zealand scrypter

I pinged Damien McKenna and asked him to have a look, it seems both of us don't know the "best practice" solution here?

🇳🇿New Zealand scrypter

Put this in modules/custom/my-migration/src/Plugin/migrate/field/d7/GelocationField.php

namespace Drupal\my_migration\Plugin\migrate\field\d7;

use Drupal\migrate_drupal\Plugin\migrate\field\FieldPluginBase;

/**
 * @MigrateField(
 *   id = "geolocation",
 *   core = {7},
 *   type_map = {
 *    "geolocation_latlng" = "geolocation",
 *   },
 *   source_module = "geolocation",
 *   destination_module = "geolocation"
 * )
 */
class GeolocationField extends FieldPluginBase {

...

}

It worked! Hope this might help others. Still wondering if it should be in the contrib /geolocation module?

🇳🇿New Zealand scrypter

On the source D7 site I have geolocation and geolocation_googlemaps modules enabled.
I was trying drush mim upgrade_d7_field. There are 264 fields and I get 1 fail, "Attempt to create a field storage field_location_map with no type".
"field_location_map" is a D7 geolocation_latlng type field.
On the D10 destination I have enabled geolocation and geolocation_google_maps.
I am wondering if there is migration for this fairly basic situation?
Thanks.

🇳🇿New Zealand scrypter

Getting same error D7 geolocation module to D10 geolocation module.
drush mim d7_field gives Attempt to create a field storage field_location_map with no type.

mysql> select field_name, type, module from field_config where field_name like '%field_location_map%';
+--------------------+--------------------+-------------+
| field_name         | type               | module      |
+--------------------+--------------------+-------------+
| field_location_map | geolocation_latlng | geolocation |
+--------------------+--------------------+-------------+
1 row in set (0.00 sec)

Is there mapping for D7 geolocation to D8/9/10 geolocation? Found type_map => ['location' => 'geolocation'] which is for location_cck but nothing for the same geolocation module source and destination? This is not a custom migration.
Could you expand on the above comment "did you align the migration field types correctly?" How is that done?

🇳🇿New Zealand scrypter

Unfortunately I don't have steps to reproduce. It is a site migrated to D10 from D7 and collections became paragraphs. It worked fine on local dev and on initial testing. Then when copied to another instance for -st testing, the error appeared.
My investigation did not discover why $entity->get() failed. With this line $linkField = $entity->get($field_link); the assumption on the next line is that $linkField is in good shape. So whether the check for !empty() is really necessary is debatable, I don't think it does any harm, just another line of defense.
No problem if you want to leave it, sorry I can't provide more useful info.

🇳🇿New Zealand scrypter

FYI, I applied the patch 3366615-15 on local site testing upgrade from D9 to D10 with 20+ forms and it works fine, no need to remove custom '#datepicker': true from each form. Much appreciated thank you.

🇳🇿New Zealand scrypter

Thanks @dromansab , that gets over the data entry error but the summary then shows the date as Mon, 08/28/2023 - 00:00 which is useless. It should be possible to set the format required, for me this is 28/08/2023. It worked fine in Drupal 9.

🇳🇿New Zealand scrypter

In reply to #3, #4 and #8, this is a real issue. I am converting a D9 site to D10, there are many forms with dates and this country uses the dd/mm/yyyy format. The data entry will only proceed if the date_date_format is Y-m-d, but then the date is wrong on the summary, the submission and subsequent processing.
Attached .yml file of a very simple test form and screenshots of the error and the Drupal date settings.
Happy to provide anything else that would help resolve this.

Production build 0.71.5 2024