> I honestly had no idea what could cause this.
It was the core change - https://www.drupal.org/node/3346038 β , preview simply returns 503 error with some stack trace.
Proxying image previews with sub-request is very tricky, I've been working on https://www.drupal.org/project/cdn/issues/3179753 β¨ Improve far-future support: generate dynamically generated files automatically (f.e. image style derivatives) Needs work some time ago, and it has more problems than I expected. Btw, using cdn + cdn_cloudfront_private was an alternative in my case when existing website had many public file fields and it was just too complex to move them to private and use drupal for giving the file response, instead I kept all files public but protected it to be accessible only by cloudfront, no one else can't, and CF signed cookie did the trick. But that's aws only solution.
thanks @ceithamer728, actually I've tried to include the case to use default parent method when grouping is enabled, but it looks like not all cases. Can you give more context what grouping filters you have, or upload screenshot of views filter configuration, will try to add some tests that covers both.
So the issue is related to core change - https://www.drupal.org/node/3346038 β , provided a fix, need testing.
zviryatko β made their first commit to this issueβs fork.
zviryatko β created an issue.
Added next widget that replaces original one.
<?php
/**
* Add field_config_cardinality support to image widget.
*/
class CardinalityImageWidget extends ImageWidget {
/**
* Gets the cardinality of the field.
*
* @return int
* The cardinality of the field.
*/
public function getCardinality(): int {
if (
$this->fieldDefinition instanceof ThirdPartySettingsInterface
) {
return (int) $this->fieldDefinition->getThirdPartySetting('field_config_cardinality', 'cardinality_config');
}
return $this->fieldDefinition->getFieldStorageDefinition()
->getCardinality();
}
/**
* {@inheritdoc}
*/
protected function formMultipleElements(FieldItemListInterface $items, array &$form, FormStateInterface $form_state) {
$elements = parent::formMultipleElements($items, $form, $form_state);
$cardinality = $this->getCardinality();
$elements["#file_upload_description"]["#cardinality"] = $cardinality;
if (count(Element::children($elements)) > $cardinality) {
$elements[$elements["#file_upload_delta"]]['#access'] = FALSE;
}
$elements[$elements["#file_upload_delta"]]["#cardinality"] = $cardinality;
if ($cardinality === 1) {
$elements[$elements["#file_upload_delta"]]["#multiple"] = FALSE;
}
return $elements;
}
}
?>
and alter original:
<?php
/**
* Implements hook_field_widget_info_alter().
*/
function custom_module_field_widget_info_alter(array &$info) {
if (isset($info['image_image'])) {
$info['image_image']['class'] = CardinalityImageWidget::class;
}
}
?>
The tricky thing is that ImageWidget and FileWidget has complex form that depends on cardinality, so there are now easy way to change it.
zviryatko β created an issue.
Oh, sorry, it doesn't that's another thing affected.
zviryatko β created an issue.
zviryatko β created an issue.
ad0z β credited zviryatko β .
Thanks, @andyg5000, by the way, adding diff is a good practice when updating someone's patches ;-)
@andyg5000, you may need to re-save search index configuration and re-export config. Patch altering the module's config schema and also adding new fields on search index configuration, probably some of them weren't saved, and later it tries to access property from configuration.
@quietone, I appreciate your patience. To clarify, a double slash represents a network-path reference, as explained in this link: RFC 3986 Section 4.2. Essentially, it should mimic the protocol of the current website URL. This is particularly useful when ensuring that links function seamlessly across both HTTP and HTTPS protocols, maintaining consistency and directing users to the same site. While Drupal typically generates links effectively, cached versions may cause issues if originally generated for HTTP but accessed via HTTPS.
Not sure what exact code in module requires php8. Btw, there still many sites still using php7, even if it coming to end soon.
I'm ok to lock it out 8+, but if there chance to fix code lines that using 8, I'd prefer to do so.
Impossible to compare views.yml changes, but that's probably because drupal sorted it on export. Code looks good, but I need to test update, 'cause it's often tricky with removing fields.
LGTM!
Many thanks for that one, also found that something went wrong with database size, but didn't have time to figure out π
Checked, it works for me. Released!
Maybe some time soon will have time to add tests...
Hello introfini, thank you for interest to this module.
Regarding this feature not sure it is needed for most of the users, but instead you can do such thing in custom code, just decorate "rest_log_subscriber" service and add custom logic to "logResponse()" method.
Maybe it'll make sense to log only if there some specific return code, like 503, 404 or something. Or as you proposed user roles. Not sure.
If you add implementation I can add that to module, but for now see no sense. Or if more people will vote π€·.
zviryatko β created an issue.
Moved listing to /admin/reports/rest_log
, settings to /admin/config/development/logging/rest_log
and renamed to "REST API Logging".
Thanks everyone.
Committed to 2.x.
Here version for any field types that extend EntityReference.
larowlan β credited zviryatko β .
Makes sense, thanks.
Hello, would like to take ownership, has long-term project to support where this module quite useful for building decoupled drupal with views. Already have a few php issues to fix and D10 support.
xiukun.zhou β credited zviryatko β .