- Issue created by @Grimreaper
- Merge request !149Issue #3502405 by grimreaper: commerce_stripe_update_8103 does not handle database prefix β (Merged) created by Grimreaper
- π«π·France Grimreaper France π«π·
Subqueries did not get the replacement {} mechanism.
- π¬π§United Kingdom joehuggans Harrogate, UK
@grimreaper I just noticed myself earlier that it's possible to get a diff file by clicking on "Plain diff" on the MR, handy feature if it works.
I've tested this on a new install with a database prefix and was not able to replicate the error with commerce_stripe_update_8103, not sure why.
However, I tested the patch and tried to db update again and it went through successfully.
- π«π·France Grimreaper France π«π·
@joe huggans, thanks for the feedbacks.
Thanks, I know the diff or patch file from a Gitlab URL. The problem is that the content of this URL will change if the MR is changed, so I need something stable to rely on. And I don't want to commit the patch file locally on my project, in case other projects needs it. So until Gitlab provide the feature to be able to pass the commit ID for the diff in the MR, I will upload patch files (generated from the MR).
Before running the update 8103, have you ensured that you had payment gateways that will match the conditions at the beginning of the udpate hook?
On your fresh install, are you starting from commerce_stripe 8.x-1.1, setup payment gateways, then update to 8.x-1.2?
- π¬π§United Kingdom joehuggans Harrogate, UK
Ahh understood yes, thanks. That would be a nice feature to pass the commit ID for the diff though.
I had Stripe Payment Element enabled previously for the payment gateway plugin, it looks like I should have tested with Stripe Card Element?
However, I'm having issues creating such a payment gateway, seeing this error -
An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /admin/commerce/config/payment-gateways/add?ajax_form=1
StatusText: error
ResponseText: The website encountered an unexpected error. Try again later.TypeError: array_map(): Argument #2 ($array) must be of type array, null given in array_map() (line 303 of modules/contrib/commerce/modules/payment/src/Plugin/Commerce/PaymentGateway/PaymentGatewayBase.php). Drupal\commerce_payment\Plugin\Commerce\PaymentGateway\PaymentGatewayBase->buildConfigurationForm() (Line: 16)
Drupal\commerce_payment\Plugin\Commerce\PaymentGateway\OnsitePaymentGatewayBase->buildConfigurationForm() (Line: 170)
Drupal\commerce_stripe\Plugin\Commerce\PaymentGateway\Stripe->buildConfigurationForm() (Line: 105)
Drupal\commerce\Plugin\Commerce\InlineForm\PluginConfiguration->buildInlineForm() (Line: 130)
Drupal\commerce_payment\Form\PaymentGatewayForm->form() (Line: 107)
Drupal\Core\Entity\EntityForm->buildForm() (Line: 66)
Drupal\commerce_payment\Form\PaymentGatewayForm->buildForm()
call_user_func_array() (Line: 536)
Drupal\Core\Form\FormBuilder->retrieveForm() (Line: 375)
Drupal\Core\Form\FormBuilder->rebuildForm() (Line: 633)
Drupal\Core\Form\FormBuilder->processForm() (Line: 326)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 73)
Drupal\Core\Controller\FormController->getContentResult()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 638)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 116)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 90)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 741)
Drupal\Core\DrupalKernel->handle() (Line: 19) - π«π·France Grimreaper France π«π·
I had "plugin: stripe_payment_element" too. But in "payment_method_types:" I had "credit_card".
I don't know where this other issue comes from. I am not on a project with stripe or commerce to try to reproduce right now.
- π¬π§United Kingdom joehuggans Harrogate, UK
I'm just trying to help out with testing.
But I can't replicate the issue, credit_card seems to be the default for the Stripe Payment Element plugin and it isn't causing an error on the update 8103.
Hopefully someone else can confirm, sorry
- π«π·France Grimreaper France π«π·
I'm just trying to help out with testing.
No worries and huge thanks for that! :)
- πΊπΈUnited States TomTech
@grimreaper,
Thanks for the report!
Took a minute to setup to circle on this one, as it has been a while since I've used a prefix. :)
Direct DB queries do support prefix substitution.
It wasn't possible to write this query using the abstraction layer, because of the subqueries.
As observed in your MR, the table names were properly wrapped with curly braces to handle prefix substitution, but for the subquery joins, the table.column needed to also be wrapped as {table}.column. (When using an alias, this isn't necessary, but for some SQL statements, aliases can't be used. For those, the full table name must be used.)
I've reproduced the issue, and the proposed MR resolves it.
Merging.
Thanks!
-
tomtech β
committed 69f9eef5 on 8.x-1.x authored by
grimreaper β
Issue #3502405 by grimreaper, tomtech: commerce_stripe_update_8103 does...
-
tomtech β
committed 69f9eef5 on 8.x-1.x authored by
grimreaper β
-
tomtech β
committed 69f9eef5 on 2.0.x authored by
grimreaper β
Issue #3502405 by grimreaper, tomtech: commerce_stripe_update_8103 does...
-
tomtech β
committed 69f9eef5 on 2.0.x authored by
grimreaper β