Account created on 4 September 2014, about 10 years ago
#

Recent comments

🇮🇹Italy sepa_cleversoft

Yes, I'm using unstructured 2.0.0. I tried to uninstall both the modules and re-install them, but the option is not there.

Back in time I was able to use unstructured on the same website.

Do you have some suggestions on how to investigate better the issue?

Thank you very much.

🇮🇹Italy sepa_cleversoft

Hello, is there an estimated release date planned for version 3.0.0-rc1? Your guidance on this would be much appreciated. Thank you!

🇮🇹Italy sepa_cleversoft

I found the issue. Was not directly related to ai module, but instead was a different module (services_api_key_auth) that was broking the website. Uninstalled it, it worked well.

Maybe can be useful for someone else, for me the issue is closed. Thank you.

🇮🇹Italy sepa_cleversoft

No, it's not solved. The code you provided worked well, so the problem for me is related to the module or something related. Maybe also the module key can be involved? How can I debug the error better?

🇮🇹Italy sepa_cleversoft

With your code I get the list of available models. Indeed, I was able also to run openai module without errors. Thank you for your support.

🇮🇹Italy sepa_cleversoft

I've tried with Drupal 10, openapi 4 and openapi_jsonapi 3.

Everything was fine during composer requires and crush installations.

When I tried to open the page with the json output I get the white page with error.

Then something strage happened: composer, for example with composer up, starts trying to apply 2 patches to the core, failing.

Then the website became inaccessible and crush broken. My only chance was to restore a backup.

I'm not sure what was the event that fires the Armageddon, but it happened.

Do anybody have a clue on what happened? :D

🇮🇹Italy sepa_cleversoft

Is enough to change the yaml file to make the version 4.x of the module compatible with Drupal 10?

Do you know if it is working with json:API to serve openAPI version 3 version of the Drupal jsonapi resources? Or are still there some issue to make it fully compatible?

🇮🇹Italy sepa_cleversoft

I fixed the problem disabling the theme debug. Very strange, but I hope this can help somebody else.

🇮🇹Italy sepa_cleversoft

I have no twig rewrite or other some of rewriting. The field is just attached to a view. The rows are rendered well, the sum is with trimmed values.

🇮🇹Italy sepa_cleversoft

Do you need more info to replicate the error?

I suspect that I don't render the field in the correct way, but I also tried everything and it always ignore the decimal separator, giving wrong result.

I don't know if it's a general issue, that affects many other cases, or just something I'm doing wrong.

Let me know if you need something.

🇮🇹Italy sepa_cleversoft

I have a view custom field, defined with this code in modules/custom/my_module/src/Plugin/views/field

<?php
 
/**
 * @file
 * Definition of Drupal\budget_giorni\Plugin\views\field\GiornateEseguite
 */
 
namespace Drupal\budget_giorni\Plugin\views\field;
 
use Drupal\views\Plugin\views\field\NumericField ;
use Drupal\views\ResultRow;
use Drupal\node\Entity\Node;

 
/**
 * Field handler to flag the node type.
 *
 * @ingroup views_field_handlers
 *
 * @ViewsField("giornate_eseguite")
 */
class GiornateEseguite extends NumericField {
 
  /**
   * @{inheritdoc}
   */
  public function query() {
    // Leave empty to avoid a query on this field.
  }
 
  /**
   * @{inheritdoc}
   */
  public function render(ResultRow $values) {
    $counter = 0;
    $node = $values->_entity;
    //dpm($node);
    $interventi_array = $node->field_interventi->getValue();
    //dpm($interventi_array);

  if (!empty($interventi_array)) {    
      foreach ($interventi_array as $intervento) {
        $intervento_node = Node::load($intervento["target_id"]);
        //dpm($intervento_node);
        if (isset($intervento_node->field_stato_intervento)) {
          $stato_intervento_tid = $intervento_node->field_stato_intervento->getString();
          //dpm($stato_intervento_tid);
          if ($stato_intervento_tid == "99") {
            if (isset($node->field_data_per_calcoli) && $node->field_data_per_calcoli->value) {
              //dpm($node->field_data_per_calcoli->value);
              if ($intervento_node->field_data_orario->value >= $node->field_data_per_calcoli->value) {
                $durata = (float) $intervento_node->field_durata->getString();
                $counter += $durata;
              }
            } else {
              $durata = (float) $intervento_node->field_durata->getString();
              $counter += $durata;
            }
          }
        }
      }
  }    
    return $counter;

  }
}

The field is shown correctly (or at lest it seems) in view. The problem is that the calculation is done without comma or dot for decimals. So 0,5 becomes 05, and the calculation fails.

🇮🇹Italy sepa_cleversoft

Is possible to refresh the view when an event happens on site?

For example, I have a view of user, and if a new user is registered the view is refreshed on every client.

I don't know how this can be possible, but maybe there are some Drupal/js relationships that I don't know about.

🇮🇹Italy sepa_cleversoft

Trying with -vvv option in composer up, I'll find this error for every hunks:

4 out of 4 hunks ignored
can't find file to patch at input line 3005
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/lib/Model/GetExtendedContactDetails.php b/lib/Model/GetExtendedContactDetails.php
|index 3bd46da..ec3369c 100644
|--- a/lib/Model/GetExtendedContactDetails.php
|+++ b/lib/Model/GetExtendedContactDetails.php
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.

🇮🇹Italy sepa_cleversoft

I cannot apply both #4 and #6 patch with composer. I'm using sendinblue 2.0.0, and trying patch composer gives this red error:

Could not apply patch! Skipping. The error was: Cannot apply patch https://www.drupal.org/files/issues/2023-01-18/3330960-4-sendinblue_api_...

This happens with both of the patches.

Drupal 9.5.2
PHP 8.1.14
sendinblue 2.0.0

🇮🇹Italy sepa_cleversoft

Thank you sahilgidwani for the quick answer. The stack is:
- PHP version 8.1.14
- drupal 9.5.2
- commerce and commerce_products 2.33.0

Let me know if you need more infos.

🇮🇹Italy sepa_cleversoft

Maybe it's easier to just think about a simple logic to recalculate the balance in transaction executed later than the modified or deleted one.

In this case a simple hook or event subscriber would be enought.

Production build 0.71.5 2024