• Resolved frzsombor

    (@frzsombor)


    When I use the “New View” and click “on “Edit” to open a donation, the page keeps loading and nothing happens.

    Debugging:

    1. On an URL like /wp-admin/edit.php?post_type=give_forms&page=give-payment-history&id=11000 an ajax call is fired to fetch data from /wp-json/givewp/v3/donations/11000?includeSensitiveData=true&anonymousDonations=include&_embed=true&_locale=user

    2. The wp-json url returns a server error:

      {
      "code": "internal_server_error",
      "message": "<p>There has been a critical error on this website.<\/p><p><a href=\"https:\/\/wordpress.org\/documentation\/article\/faq-troubleshooting\/\">Learn more about troubleshooting WordPress.<\/a><\/p>",
      "data": {
      "status": 500,
      "error": {
      "type": 1,
      "message": "Uncaught Give\\Framework\\Database\\Exceptions\\DatabaseQueryException: Database Query in \/httpdocs\/wp-content\/plugins\/give\/src\/Framework\/Database\/DB.php:250\nStack trace:\n#0 \/httpdocs\/wp-content\/plugins\/give\/src\/Framework\/Database\/DB.php(86): Give\\Framework\\Database\\DB::runQueryWithErrorChecking()\n#1 \/httpdocs\/wp-content\/plugins\/give\/src\/Framework\/Models\/ModelQueryBuilder.php(100): Give\\Framework\\Database\\DB::__callStatic()\n#2 \/httpdocs\/wp-content\/plugins\/give\/src\/EventTickets\/Repositories\/EventTicketRepository.php(303): Give\\Framework\\Models\\ModelQueryBuilder->getAll()\n#3 \/httpdocs\/wp-content\/plugins\/give\/src\/Donations\/Models\/Donation.php(277): Give\\EventTickets\\Repositories\\EventTicketRepository->getTotalByDonation()\n#4 \/httpdocs\/wp-content\/plugins\/give\/src\/API\/REST\/V3\/Routes\/Donations\/ViewModels\/DonationViewModel.php(62): Give\\Donations\\Models\\Donation->eventTicketsAmount()\n#5 \/httpdocs\/wp-content\/plugins\/give\/src\/API\/REST\/V3\/Routes\/Donations\/DonationController.php(285): Give\\API\\REST\\V3\\Routes\\Donations\\ViewModels\\DonationViewModel->exports()\n#6 \/httpdocs\/wp-includes\/rest-api\/class-wp-rest-server.php(1292): Give\\API\\REST\\V3\\Routes\\Donations\\DonationController->get_item()\n#7 \/httpdocs\/wp-includes\/rest-api\/class-wp-rest-server.php(1125): WP_REST_Server->respond_to_request()\n#8 \/httpdocs\/wp-includes\/rest-api\/class-wp-rest-server.php(439): WP_REST_Server->dispatch()\n#9 \/httpdocs\/wp-includes\/rest-api.php(467): WP_REST_Server->serve_request()\n#10 \/httpdocs\/wp-includes\/class-wp-hook.php(341): rest_api_loaded()\n#11 \/httpdocs\/wp-includes\/class-wp-hook.php(365): WP_Hook->apply_filters()\n#12 \/httpdocs\/wp-includes\/plugin.php(570): WP_Hook->do_action()\n#13 \/httpdocs\/wp-includes\/class-wp.php(418): do_action_ref_array()\n#14 \/httpdocs\/wp-includes\/class-wp.php(821): WP->parse_request()\n#15 \/httpdocs\/wp-includes\/functions.php(1343): WP->main()\n#16 \/httpdocs\/wp-blog-header.php(16): wp()\n#17 \/httpdocs\/index.php(17): require('...')\n#18 {main}\n thrown",
      "file": "\/httpdocs\/wp-content\/plugins\/give\/src\/Framework\/Database\/DB.php",
      "line": 250
      }
      },
      "additional_errors": []
      }

      3. To find out more info, in src/Framework/Database/DB.php in runQueryWithErrorChecking() function I add var_dump($wpError); and var_dump($wpdb->last_query); – now the error shows as:

      object(WP_Error)#24042 (3) {
      ["errors"]=>
      array(1) {
      ["db_delta_error"]=>
      array(1) {
      [0]=>
      string(207) "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE 1 = 0) AS tickets WHERE tickets.donation_id = '11000'' at line 1"
      }
      }
      ["error_data"]=>
      array(0) {
      }
      ["additional_data":protected]=>
      array(0) {
      }
      }

      string(229) "SELECT * FROM (SELECT NULL as id, NULL as event_id, NULL as ticket_type_id, NULL as donation_id, NULL as amount, NULL as created_at, NULL as updated_at, NULL as currency WHERE 1 = 0) AS tickets WHERE tickets.donation_id = '11000'"

      4. This query is coming from src/EventTickets/Repositories/EventTicketRepository.php from prepareQuery() and it clearly looks invalid, missing a FROM in the subquery.

    Viewing 2 replies - 1 through 2 (of 2 total)
    • Plugin Support Ginger Coolidge

      (@gscoolidge)

      Hello @frzsombor ,

      The underlying issue of what you are reporting is most likely a database update issue that is causing these errors.

      Given the information we’ll need for troubleshooting, please reach out to us via our contact form at https://givewp.com/contact-us/? Use the option that says “I am responding to a request to contact you.” Provide the link to this thread as context, and also your system information.

      To do this, navigate to GiveWP > Tools > System Info (tab), click the button to Get System Report and copy/paste ALL of the text in your email reply.  Here is a (silent) video showing you were to find and copy this info.

      https://www.loom.com/share/cc68cd6b3ecf4b32b28f3d6656291ba4

      I’m marking it as resolved here since we’re resuming assisting you elsewhere.

      We look forward to guiding you to a resolution here! 🙂

      Hola! cuando creo una campaña se queda cargado, tengo que actualizar el navegador, eliminar el caché, y cuando vuelvo a entrar ya están allí, le doy editar, y se queda cargando, descargué el plugins directo de wordpress y pasa eso, lo descargué con una versión anterior, y empezó a funcionar bien, pero otra vez volvió a generarse el mismo error

    Viewing 2 replies - 1 through 2 (of 2 total)

    You must be logged in to reply to this topic.