@eduardo-morales-alberti @qzmenko @drunken-monkey @mkalkbrenner @marios-anagnostopoulos
I tested the patches #44 and #48 on the search_api 8.x-1.34 (not 1.35 due to
https://www.drupal.org/project/search_api/issues/3454939
š
Declaration of Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend::__sleep() must be compatible
Active
) running on Drupal 10.2.5 using Acquia Search API Solr Server.
I have a search api index with multiple entity reference fields (pointing to content types and taxonomies).
BTW, is Paragraph entity type supported?
I have the option "Track changes in referenced entities" enabled.
I still can't see the "Exclude field references entities unpublished from results." processor on my index.
Does it matter what Search API server is used?
What I am missing?
I have this exact need.
I'm using JSONAPI on an index indexing nodes with field realation to paragraphs.
Some paragraphs could be unpublished and I would like to JSONAPI avoid representing these unpublished node on the result.
FYI - As the consumer user don't have permissions for reading unpublished content, then JSONAPI only returns the entity type and the UUID without any other extra information, but at on the `meta` -> `omitted`section JSONAPI adds references of entites returned that don't have enough permissions on the `data` section.
I'm trying to skip search api to index the unpublished related content, then JSONAPI not returning unpublished entities and no mention about them on the `omitted` section.
Is the latest patch file tested or ready to be used on prod or merged into https://www.drupal.org/project/search_api/releases/8.x-1.x-dev ā ?
@drunken-monkey that is an interesting approach ...
I tried it and this was the result:
- I created an aggregated field with my 3 location fields.
- I exported the configuration and changed by hand the 3 fields to point to the nested geofield and nested lat/lon value (just like I see when drilling down a single location field).
- I imported the configuration.
- I reindexed again and cleared caches.
- I tested my query using the search_api_location filter aggregated field value.
- Always get no results no matter how big radius I use.
This is how the aggregated field looks like after manual tweaking:
field_locations_union:
label: 'Locations Union'
property_path: aggregated_field
type: location
configuration:
type: union
fields:
- 'entity:node/field_common_locations:field_ph_coordinates:latlon'
- 'entity:node/field_en_locations:field_ph_coordinates:latlon'
- 'entity:node/field_ph_locations:field_ph_coordinates:latlon'
This is how the search api query location filter looks like:
$location_options[] = [
'field' => 'field_locations_union',
'lat' => $geocoding['lat'],
'lon' => $geocoding['lon'],
'radius' => $geocoding['radius'],
];
$query->setOption('search_api_location', $location_options);
I was curious how the UI will behave after reimporting the manual tweaked configuration ... It looked like if no fields were selected to be combined. However if I exported the configuration again, the manual changes remain the same, so they are not destroyed on subsequent config exports.
Any other hint or idea?
Hi,
Any progress on it?
I have a similar requirement.
I have a Provider content type with 3 entity reference fields to another Location content type.
I would like to combine the 3 location fields into 1, then drill down this new index field to get the latitude / longitude of a geofield existing on the Location node and be able to filter by location distance from them.
Thank you.
Hi,
I would like to combine location fields who have latitude / longitude fields on it to be able to filter by distance.
I can make it work for 1 single field, I just drill down till the coordinates latlon pairs and configure the field type to latitude/longitude.
But now I have a main content type with 3 entity reference fields to a location content type.
The location content type contains the geofield.
I want to combine the 3 and filter by location (distance) on the 3 at a time.
I tried creating a Processor Plugin but wasn't able to accomplish what I needed.
I tried the Union aggregation but that aggregates the whole referenced entity.
I need to drill down to the coordinates latlon on the combined as an indexed field I can use on my index.
Is there a way to drill down on an aggregated field?
What is the best wat to do this?
Thanks.
I can add more info, I guess this might be something related with how and where the temporary files are stored.
Each Acquia environment have a different Drupal temporary folder configured, it works for all envs except for prod.
Might be something at the folder level, permissions, symlink or something on how Acquia is handling that temporary folder at `mnt/tmp/MYCONTAINERENV` directory.
Does this ring any bell?
Thanks
Hi @nginex,
I have the same problem.
I'm using Single Content Sync 1.4.3, Drupal Core 9.5.11 and PHP 8.1.24
I'm using Acquia hosting.
I'm not using any Drupal Core patch for this purpose though.
The weird thing is that the import works fine on dev, qa and uat environments but fails on prod environment.
All the environments have the same configuration deployed.
I can export on uat and import into dev or qa but I get the error when importing into prod.
ValueError: ZipArchive::open(): Argument #1 ($filename) cannot be empty in ZipArchive->open() (line 31 of /mnt/www/html/MYCONTAINER/app/MYAPP/docroot/core/lib/Drupal/Core/Archiver/Zip.php)
#0 /mnt/www/html/MYCONTAINER/app/MYAPP/docroot/core/lib/Drupal/Core/Archiver/Zip.php(31): ZipArchive->open('')
I can see on the imported environment (dev, qa, and even prod) at `/admin/content/files` that my file has been uploaded as a temporary status.
Thanks.
Thanks @adriancid, but still don't get how to add the render_class key on the @ExtraFieldDisplay plugin annotation.
Adding the render_class key as another parameter and then implementing the render class, seems to do nothing.
I might be missing something.
Any code example complete using https://www.drupal.org/project/extra_field ā with https://www.drupal.org/project/extrafield_views_integration ā ?
drupal-son ā created an issue. See original summary ā .
Hi there. Still no updates on this? Were you able to reproduce?
Hi @nginex, any update on this? Were you able to reproduce the issue?
drupal-son ā created an issue.
@nginex this might sound weird but I was able to make the patch work, not sure why it didn't work the last time.
I think this is RTBM.
BTW, I was also able to export a custom field using the export/import hooks. It worked like a charm.
Were you able to reproduce the issue?
Do you think it is useful to share my yml file so you can see the generated structure?
@nginex I can confirm that my content type has some paragraph multivalue fields, where the paragraph contains the long text WYSIWYG field, where multiple media images are embedded. These images are not exported into the zip package.
Just for clarifying, at the same time, the content type has media fields. These images are exported fine into the zip package.
The content type has other referenced media entities fields, for those cases, the images were exported without issues.
Another thing to mention, my long_text contains more than 1 media embed (3 of them to be more exact), also more than 1 long_text field too with multiple
media embeds.
The yml contains the 3 uuid but the images are not into the assets folder.
Iām not at the desk right now, I need to check the content type structure, but it might be possible that this is a multi value paragraph that contains some fields and the long text with media embeds into it.
@nginex Sorry for the delay, not so easy to test as I need 2 environments with the patch applied.
The YML file looks good, I compared it before and after the patch, and now it seems to have the embedded entity with all its attributes.
However, the image itself on the assets folder wasn't generated.
When imported, the media entity was created but with a broken default image.
Does it make sense?
OMG, you are faster than me :)
Let me test the patch and I'll let you know in a bit.
Thanks.
That sounds great!
SCS module is really really useful, I'm using it to replacing a full database clone from environments (which I hate), but as soon as my user finds a use case when it doesn't export a specific field, he push back to database cloning method again.
I envision this module could be part of Core not too late.
The Entity Embed into WYSIWYG solution is widely used in multiple websites, so the module must support it In order to be part of it.
I would like to contribute somehow, I reviewed the documentation page
https://www.drupal.org/docs/contributed-modules/single-content-sync/expo... ā
for trying to understand the underlying data structure, but because the exports run on a batch, it is not easy to debug.
Can you point me with better real examples on how to extend the module to support a custom fields or not-yet-supported contributed fields?
The fix for my other feature request https://www.drupal.org/project/single_content_sync/issues/3332663 š Avoid importing entity into another website Fixed worked amazingly, even more features that I imagined. Thank you for that.
Hi @nginx and folks, any update on this?
Is this a bug or a feature request to support entity (media in this case) embeds on WYSIWYG when exporting?
Thanks for this great module.