Hi @nidhi27, yes, please proceed.
Thanks @vyasdhruv, @dimitrihokonmoy I've published it in the new release https://www.drupal.org/project/par/releases/3.0.6 β .
Also, I found another issue: when the user wants to clone old Product, there is a chance that a newly generated SKU will be the same as the existing one (from one of the Products created later). Here's the fix for it:
$sku_query = $this->database->select('commerce_product_variation_field_data', 'v')
->fields('v', ['sku']);
$sku_query_order = $sku_query->addExpression('CAST(sku as UNSIGNED)');
$sku_query->orderBy($sku_query_order, 'DESC');
$latest_sku_record = $sku_query->range(0, 1)->execute()->fetch();
$new_sku = $latest_sku_record->sku + 1;
But the Connection should be added by the dependency injection in order to be used as $this->database.
Call to undefined method Drupal\node\Entity\Node::setVariations() in Drupal\commerce_entity_clone\EventSubscriber\ProductEntityCloneSubscriber->ProductEntityPreClone() (line 22 of modules/commerce_entity_clone/src/EventSubscriber/ProductEntityCloneSubscriber.php)
This issue can be fixed by wrapping the code inside the ProductEntityPreClone function:
public function ProductEntityPreClone(EntityCloneEvent $event) {
$original = $event->getEntity();
if ($original instanceof Product) {
// The rest of the code.
}
}
And also use the Product class at the top of the file:
use Drupal\commerce_product\Entity\Product;
I checked the patch from #61, and there is another bug. My steps:
1. I set 6 items to show on load
2. I set 3 items to add on each "load more" click (I use the button)
Result: when I have 3 items in total, no "load more" button is shown (correct). But after creating another node, I have this behavior: it shows 4 nodes and (here's the error itself) the "load more" button. After clicking on this button, it disappears (without adding any item because everything is already displayed).
Hi, can you release the fix from #5 comment?
Released in 3.0.5 version.
Here's the patch if someone needs it.
I tried to remove some field_storage_definitions related to the field_encrypt module in the key_value table (during module uninstallation). After that, I was able to create new users.
I created a Merge request with my changes.
Hi @dineshkumarbollu,
Yes, please create the patch. I still can't reproduce the issue.
@die-josi if possible please check the patch when it's done.
Hello die-josi, could you please provide steps to reproduce the issue?