Validation error on a second device for subscriptions - Woocommerce integration kit

I perfomed a new test about the issue of this post.
I tried to remove the ID hardware of the device in the order page and I receive the error message:

“Cannot validate your subscription, no previous activation was found in the order database”

whit no possibility for the user to do anything. The user can’t insert a new activation key after the error window message, so he is stuck.

So the bug is in the activation process of the 2nd device, because the algorithm doesn’t append the ID hardware of the 2nd device in the custom field xlspadlock_activations_XXXX in the order page.

I hope there will be a bug fix as soon as possible.

Marco

That would be awesome!
May I please know when will the update ready? I almost finished setup my website and only wait for packaging the workbook. If 2023 version is soon to come I definitely willing to wait for it to avoid future transfer.

1 Like

I’m very happy that a new version of xls padlock is coming up.
In the meanwhile I wait for news from you about the bug of this thread.

Thanks
Marco

I have a temporary solution for this issue.
I created a blank protected workbook to send the customer for the second activation.
The only purpose is to allow the client to obtain the ID hardware of his 2nd device using the userfrom of the activation procedure.
So the client sends me the ID hardware and I manually add it in the personalized field of the woocommerce order page.
Maybe this solution can be useful for you too.

1 Like

I add further details to the issue of this discussion.

The first and second activation are successfully completed, but the ID hardware of the second activation is not appended in the personalized field xlspadlock_activations_10669.

As you can see in the attached image, in the field xlspadlock_activations_10669 of the woocommerce order page there is only the ID hardware of the first device.

The absence of the second device ID hardware is the origin of the validation error.

@gdgsupport is it possible to have any news about the bug of this thread and about the time it will take to fix it?
Thanks
Marco

@gdgsupport
Looks like I have the same issue, there is a bug in the subcontroller.php:

Can you please provide a fix for this bug?
thank you

I’m waiting for that bugfix too. Hope it will be available soon :pray:

waiting since may? Sounds too much…
If the activation is successful, that’s the moment when the next system ID’s should be added to order custom field, in order to get a successful validation.
doactivation function is not working properly, online activation is useless if a user can activate only once, each user will have to subscribe separately.

I know. I’m in trouble because I have to provide manually for the second activation for each user.
It’s very ugly.

was able to fix the subcontroller, stupid mistakes in there…
Should be:
if ($b) {
$order_data->update_meta_data(“xlspadlock_activations_$product_id”, $existing_activations_str);
$order_data->save_meta_data();
}

before, was: if (!$b)

However, since wp 6.3.0, there are many issues that need to be fixed,
$order_item->product_id fails, should be now:
$order_item->get_product_id()
And many similar changes

Yes, our WP engineer will release an updated kit for these breaking changes on this Monday. Thanks for the report!

Great! Will it possible for the user to deactivate the protected workbook and reactivate on a different device?
It should be a feature of the new version of xls padlock, right?

Yes, it’s in the next incoming version. There is a new Deactivation feature and we’ll also update the WooCommerce Integration Kit when it is available.
However, it’s not yet in the fix we’ll release on Monday.

correction:
if ($b) or if (!$b) is wrong, should not even be here, it’s wrong logic.
If true, it means that the custom field xlspadlock_activations_$product_id was found in order, the app will append a new system id to existing string, BUT will not create the custom field if does not exist!

If not true, means that the custom field does not exist, will be created with the first system id, BUT it will NOT append next validations.

There should be NO if statement at all, works as designed ONLY with:
$order_data->update_meta_data(“xlspadlock_activations_$product_id”, $existing_activations_str);
$order_data->save_meta_data();

I believe it never worked as intended, for orders with a quantity more than 1, and that is a shocking surprise.
Hope it helps.

Actually, the code itself is not erroneous.
The condition was here to create the meta field if it was not present. If it was, no need to create it again, we change its value only and after that we save the order, including meta data. It used to work before, but it seems it has changed somehow.
Anyway, this will be fixed on Monday.

In pseudo code, the logic was like this: if field does not exist, create it.
There was indeed a field update line:
if (“xlspadlock_activations_$product_id” == $meta_item->key) {
$meta_item->value = $existing_activations_str;
$b = true;
break;
}
The problem in this approach is that there is no save, order data is saved only on first activation, when the field doesn’t exist, meta_item->value is set, but not saved/updated to store order.
What should have been is maybe: if field exists, update it, else create it.

Tested many times, without any if statement the code works perfectly, the custom field is added only once on first activation and updated on next ones, no matter how many users activate the token.
Anyway, works fine now, these are my first php lines I ever wrote, never coded in php before.

Can you tell us an approximate date for the release of new version of xls padlock?
Thanks

Next release of XLS Padlock will be published on next week. Thank you.

Ok, thanks for the update.