Skip to content

Fix QR code generation for batch invoice processing#1451

Draft
Copilot wants to merge 92 commits intoprep/v172from
copilot/fix-qr-code-generation-issue
Draft

Fix QR code generation for batch invoice processing#1451
Copilot wants to merge 92 commits intoprep/v172from
copilot/fix-qr-code-generation-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 9, 2026

Problem

Invoices generated in the same request (cron jobs, bulk operations) all contain identical QR codes from the first invoice. CodeIgniter 3's $CI->load->library() instantiates only once per request and silently ignores parameters on subsequent calls.

Changes

Replace library loader with direct instantiation in application/helpers/invoice_helper.php:

Before:

$CI->load->library('QrCode', ['invoice' => $invoice]);
$qrcode_data_uri = $CI->qrcode->generate();

After:

require_once APPPATH . 'libraries/QrCode.php';
$qrcode = new QrCode(['invoice' => $invoice]);
$qrcode_data_uri = $qrcode->generate();

Each invoice now receives a fresh QrCode instance with correct payment data.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/Bacon/BaconQrCode/zipball/8674e51bb65af933a5ffaf1c308a660387c35c22
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/CXPERa /usr/bin/composer install --no-interaction rep cron\|schedule els/Mdl_user_cli-l ndor/bin/grep grep -l cron\|schedule invoices/views/partial_itemlist_responsive.php nfig/composer/vendor/bin/grep cron\|schedule x.php cal/bin/grep grep (http block)
  • https://api.github.com/repos/DASPRiD/Enum/zipball/b5874fa9ed0043116c72162ec7f4fb50e02e7cce
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/CXPERa /usr/bin/composer install --no-interaction rep cron\|schedule els/Mdl_user_cli-l ndor/bin/grep grep -l cron\|schedule invoices/views/partial_itemlist_responsive.php nfig/composer/vendor/bin/grep cron\|schedule x.php cal/bin/grep grep (http block)
  • https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/e01f4a821471308ba86aa202fed6698b6b695e3b
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/CXPERa /usr/bin/composer install --no-interaction rep cron\|schedule els/Mdl_user_cli-l ndor/bin/grep grep -l cron\|schedule invoices/views/partial_itemlist_responsive.php nfig/composer/vendor/bin/grep cron\|schedule x.php cal/bin/grep grep (http block)
  • https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/0ca86845ce43291e8f5692c7356fccf3bcf02bf4
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/CXPERa /usr/bin/composer install --no-interaction rep cron\|schedule els/Mdl_user_cli-l ndor/bin/grep grep -l cron\|schedule invoices/views/partial_itemlist_responsive.php nfig/composer/vendor/bin/grep cron\|schedule x.php cal/bin/grep grep (http block)
  • https://api.github.com/repos/PHPMailer/PHPMailer/zipball/d1ac35d784bf9f5e61b424901d5a014967f15b12
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/CXPERa /usr/bin/composer install --no-interaction rep cron\|schedule els/Mdl_user_cli-l ndor/bin/grep grep -l cron\|schedule invoices/views/partial_itemlist_responsive.php nfig/composer/vendor/bin/grep cron\|schedule x.php cal/bin/grep grep (http block)
  • https://api.github.com/repos/Setasign/FPDF/zipball/0838e0ee4925716fcbbc50ad9e1799b5edfae0a0
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/CXPERa /usr/bin/composer install --no-interaction rep cron\|schedule els/Mdl_user_cli-l ndor/bin/grep grep -l cron\|schedule invoices/views/partial_itemlist_responsive.php nfig/composer/vendor/bin/grep cron\|schedule x.php cal/bin/grep grep (http block)
  • https://api.github.com/repos/Setasign/FPDI/zipball/4b53852fde2734ec6a07e458a085db627c60eada
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/CXPERa /usr/bin/composer install --no-interaction rep cron\|schedule els/Mdl_user_cli-l ndor/bin/grep grep -l cron\|schedule invoices/views/partial_itemlist_responsive.php nfig/composer/vendor/bin/grep cron\|schedule x.php cal/bin/grep grep (http block)
  • https://api.github.com/repos/endroid/qr-code/zipball/0db25b506a8411a5e1644ebaa67123a6eb7b6a77
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/CXPERa /usr/bin/composer install --no-interaction rep cron\|schedule els/Mdl_user_cli-l ndor/bin/grep grep -l cron\|schedule invoices/views/partial_itemlist_responsive.php nfig/composer/vendor/bin/grep cron\|schedule x.php cal/bin/grep grep (http block)
  • https://api.github.com/repos/filp/whoops/zipball/d2102955e48b9fd9ab24280a7ad12ed552752c4d
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/CXPERa /usr/bin/composer install --no-interaction rep cron\|schedule els/Mdl_user_cli-l ndor/bin/grep grep -l cron\|schedule invoices/views/partial_itemlist_responsive.php nfig/composer/vendor/bin/grep cron\|schedule x.php cal/bin/grep grep (http block)
  • https://api.github.com/repos/guzzle/guzzle/zipball/b51ac707cfa420b7bfd4e4d5e510ba8008e822b4
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/CXPERa /usr/bin/composer install --no-interaction rep cron\|schedule els/Mdl_user_cli-l ndor/bin/grep grep -l cron\|schedule invoices/views/partial_itemlist_responsive.php nfig/composer/vendor/bin/grep cron\|schedule x.php cal/bin/grep grep (http block)
  • https://api.github.com/repos/guzzle/promises/zipball/481557b130ef3790cf82b713667b43030dc9c957
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/CXPERa /usr/bin/composer install --no-interaction rep cron\|schedule els/Mdl_user_cli-l ndor/bin/grep grep -l cron\|schedule invoices/views/partial_itemlist_responsive.php nfig/composer/vendor/bin/grep cron\|schedule x.php cal/bin/grep grep (http block)
  • https://api.github.com/repos/guzzle/psr7/zipball/21dc724a0583619cd1652f673303492272778051
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/CXPERa /usr/bin/composer install --no-interaction rep cron\|schedule els/Mdl_user_cli-l ndor/bin/grep grep -l cron\|schedule invoices/views/partial_itemlist_responsive.php nfig/composer/vendor/bin/grep cron\|schedule x.php cal/bin/grep grep (http block)
  • https://api.github.com/repos/laravel/pint/zipball/c67b4195b75491e4dfc6b00b1c78b68d86f54c90
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/CXPERa /usr/bin/composer install --no-interaction rep cron\|schedule els/Mdl_user_cli-l ndor/bin/grep grep -l cron\|schedule invoices/views/partial_itemlist_responsive.php nfig/composer/vendor/bin/grep cron\|schedule x.php cal/bin/grep grep (http block)
  • https://api.github.com/repos/moneyphp/money/zipball/b358727ea5a5cd2d7475e59c31dfc352440ae7ec
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/CXPERa /usr/bin/composer install --no-interaction rep cron\|schedule els/Mdl_user_cli-l ndor/bin/grep grep -l cron\|schedule invoices/views/partial_itemlist_responsive.php nfig/composer/vendor/bin/grep cron\|schedule x.php cal/bin/grep grep (http block)
  • https://api.github.com/repos/mpdf/mpdf/zipball/b59670a09498689c33ce639bac8f5ba26721dab3
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/CXPERa /usr/bin/composer install --no-interaction rep cron\|schedule els/Mdl_user_cli-l ndor/bin/grep grep -l cron\|schedule invoices/views/partial_itemlist_responsive.php nfig/composer/vendor/bin/grep cron\|schedule x.php cal/bin/grep grep (http block)
  • https://api.github.com/repos/mpdf/psr-http-message-shim/zipball/f25a0153d645e234f9db42e5433b16d9b113920f
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/CXPERa /usr/bin/composer install --no-interaction rep cron\|schedule els/Mdl_user_cli-l ndor/bin/grep grep -l cron\|schedule invoices/views/partial_itemlist_responsive.php nfig/composer/vendor/bin/grep cron\|schedule x.php cal/bin/grep grep (http block)
  • https://api.github.com/repos/mpdf/psr-log-aware-trait/zipball/a633da6065e946cc491e1c962850344bb0bf3e78
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/CXPERa /usr/bin/composer install --no-interaction rep cron\|schedule els/Mdl_user_cli-l ndor/bin/grep grep -l cron\|schedule invoices/views/partial_itemlist_responsive.php nfig/composer/vendor/bin/grep cron\|schedule x.php cal/bin/grep grep (http block)
  • https://api.github.com/repos/myclabs/DeepCopy/zipball/07d290f0c47959fd5eed98c95ee5602db07e0b6a
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/CXPERa /usr/bin/composer install --no-interaction rep cron\|schedule els/Mdl_user_cli-l ndor/bin/grep grep -l cron\|schedule invoices/views/partial_itemlist_responsive.php nfig/composer/vendor/bin/grep cron\|schedule x.php cal/bin/grep grep (http block)
  • https://api.github.com/repos/paragonie/random_compat/zipball/96c132c7f2f7bc3230723b66e89f8f150b29d5ae
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/CXPERa /usr/bin/composer install --no-interaction rep cron\|schedule els/Mdl_user_cli-l ndor/bin/grep grep -l cron\|schedule invoices/views/partial_itemlist_responsive.php nfig/composer/vendor/bin/grep cron\|schedule x.php cal/bin/grep grep (http block)
  • https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/CXPERa /usr/bin/composer install --no-interaction rep cron\|schedule els/Mdl_user_cli-l ndor/bin/grep grep -l cron\|schedule invoices/views/partial_itemlist_responsive.php nfig/composer/vendor/bin/grep cron\|schedule x.php cal/bin/grep grep (http block)
  • https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/CXPERa /usr/bin/composer install --no-interaction rep cron\|schedule els/Mdl_user_cli-l ndor/bin/grep grep -l cron\|schedule invoices/views/partial_itemlist_responsive.php nfig/composer/vendor/bin/grep cron\|schedule x.php cal/bin/grep grep (http block)
  • https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/CXPERa /usr/bin/composer install --no-interaction rep cron\|schedule els/Mdl_user_cli-l ndor/bin/grep grep -l cron\|schedule invoices/views/partial_itemlist_responsive.php nfig/composer/vendor/bin/grep cron\|schedule x.php cal/bin/grep grep (http block)
  • https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/CXPERa /usr/bin/composer install --no-interaction rep cron\|schedule els/Mdl_user_cli-l ndor/bin/grep grep -l cron\|schedule invoices/views/partial_itemlist_responsive.php nfig/composer/vendor/bin/grep cron\|schedule x.php cal/bin/grep grep (http block)
  • https://api.github.com/repos/phpstan/phpstan/zipball/9e800e6bee7d5bd02784d4c6069b48032d16224f
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/CXPERa /usr/bin/composer install --no-interaction rep cron\|schedule els/Mdl_user_cli-l ndor/bin/grep grep -l cron\|schedule invoices/views/partial_itemlist_responsive.php nfig/composer/vendor/bin/grep cron\|schedule x.php cal/bin/grep grep (http block)
  • https://api.github.com/repos/pocketarc/codeigniter/zipball/d310726565c12ba99b8037e8fb231ed739258e6e
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/CXPERa /usr/bin/composer install --no-interaction rep cron\|schedule els/Mdl_user_cli-l ndor/bin/grep grep -l cron\|schedule invoices/views/partial_itemlist_responsive.php nfig/composer/vendor/bin/grep cron\|schedule x.php cal/bin/grep grep (http block)
  • https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/CXPERa /usr/bin/composer install --no-interaction rep cron\|schedule els/Mdl_user_cli-l ndor/bin/grep grep -l cron\|schedule invoices/views/partial_itemlist_responsive.php nfig/composer/vendor/bin/grep cron\|schedule x.php cal/bin/grep grep (http block)
  • https://api.github.com/repos/rectorphp/rector/zipball/9afc1bb43571b25629f353c61a9315b5ef31383a
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/CXPERa /usr/bin/composer install --no-interaction rep cron\|schedule els/Mdl_user_cli-l ndor/bin/grep grep -l cron\|schedule invoices/views/partial_itemlist_responsive.php nfig/composer/vendor/bin/grep cron\|schedule x.php cal/bin/grep grep (http block)
  • https://api.github.com/repos/schmittjoh/php-option/zipball/75365b91986c2405cf5e1e012c5595cd487a98be
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/CXPERa /usr/bin/composer install --no-interaction rep cron\|schedule els/Mdl_user_cli-l ndor/bin/grep grep -l cron\|schedule invoices/views/partial_itemlist_responsive.php nfig/composer/vendor/bin/grep cron\|schedule x.php cal/bin/grep grep (http block)
  • https://api.github.com/repos/smhg/sepa-qr-data-php/zipball/837d98eae6fdcf61aaffddb5d9c61b535ee7ce1a
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/CXPERa /usr/bin/composer install --no-interaction rep cron\|schedule els/Mdl_user_cli-l ndor/bin/grep grep -l cron\|schedule invoices/views/partial_itemlist_responsive.php nfig/composer/vendor/bin/grep cron\|schedule x.php cal/bin/grep grep (http block)
  • https://api.github.com/repos/stripe/stripe-php/zipball/7e1c4b5d2beadeaeddc42fd1f8a50fdb18b37f30
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/CXPERa /usr/bin/composer install --no-interaction rep cron\|schedule els/Mdl_user_cli-l ndor/bin/grep grep -l cron\|schedule invoices/views/partial_itemlist_responsive.php nfig/composer/vendor/bin/grep cron\|schedule x.php cal/bin/grep grep (http block)
  • https://api.github.com/repos/symfony/deprecation-contracts/zipball/63afe740e99a13ba87ec199bb07bbdee937a5b62
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/CXPERa /usr/bin/composer install --no-interaction rep cron\|schedule els/Mdl_user_cli-l ndor/bin/grep grep -l cron\|schedule invoices/views/partial_itemlist_responsive.php nfig/composer/vendor/bin/grep cron\|schedule x.php cal/bin/grep grep (http block)
  • https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/CXPERa /usr/bin/composer install --no-interaction rep cron\|schedule els/Mdl_user_cli-l ndor/bin/grep grep -l cron\|schedule invoices/views/partial_itemlist_responsive.php nfig/composer/vendor/bin/grep cron\|schedule x.php cal/bin/grep grep (http block)
  • https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/CXPERa /usr/bin/composer install --no-interaction rep cron\|schedule els/Mdl_user_cli-l ndor/bin/grep grep -l cron\|schedule invoices/views/partial_itemlist_responsive.php nfig/composer/vendor/bin/grep cron\|schedule x.php cal/bin/grep grep (http block)
  • https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/CXPERa /usr/bin/composer install --no-interaction rep cron\|schedule els/Mdl_user_cli-l ndor/bin/grep grep -l cron\|schedule invoices/views/partial_itemlist_responsive.php nfig/composer/vendor/bin/grep cron\|schedule x.php cal/bin/grep grep (http block)
  • https://api.github.com/repos/symfony/var-dumper/zipball/cfae1497a2f1eaad78dbc0590311c599c7178d4a
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/CXPERa /usr/bin/composer install --no-interaction rep cron\|schedule els/Mdl_user_cli-l ndor/bin/grep grep -l cron\|schedule invoices/views/partial_itemlist_responsive.php nfig/composer/vendor/bin/grep cron\|schedule x.php cal/bin/grep grep (http block)
  • https://api.github.com/repos/vlucas/phpdotenv/zipball/955e7815d677a3eaa7075231212f2110983adecc
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/CXPERa /usr/bin/composer install --no-interaction rep cron\|schedule els/Mdl_user_cli-l ndor/bin/grep grep -l cron\|schedule invoices/views/partial_itemlist_responsive.php nfig/composer/vendor/bin/grep cron\|schedule x.php cal/bin/grep grep (http block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Summary by CodeRabbit

  • Refactor
    • Improved internal structure of QR code generation for invoices. No changes to user-facing functionality.

nielsdrost7 and others added 30 commits August 21, 2025 17:21
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
nielsdrost7 and others added 13 commits February 4, 2026 05:34
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…as HTML

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Remove pull_request trigger from frontend test workflow.
Remove pull_request trigger from PHP testing workflow
…as HTML

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…ction vulnerabilities (#1441)

* Initial plan

* Apply code review feedback: improve regex handling and log sanitization

Co-authored-by: nielsdrost7 <47660417+nielsdrost7@users.noreply.github.com>

* Refactor: Extract sanitize_for_logging helper to follow DRY principles

Co-authored-by: nielsdrost7 <47660417+nielsdrost7@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: nielsdrost7 <47660417+nielsdrost7@users.noreply.github.com>
* Initial plan

* Add comprehensive guidelines and Copilot instructions for security and DRY principles

Co-authored-by: nielsdrost7 <47660417+nielsdrost7@users.noreply.github.com>

* Add comprehensive security and DRY analysis for PR #1441

Co-authored-by: nielsdrost7 <47660417+nielsdrost7@users.noreply.github.com>

* Address code review feedback: improve documentation clarity and examples

Co-authored-by: nielsdrost7 <47660417+nielsdrost7@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: nielsdrost7 <47660417+nielsdrost7@users.noreply.github.com>
…ed (#1443)

* Initial plan

* Add comprehensive security audit documentation for XSS vulnerability

Co-authored-by: nielsdrost7 <47660417+nielsdrost7@users.noreply.github.com>

* Add executive security summary for XSS vulnerability verification

Co-authored-by: nielsdrost7 <47660417+nielsdrost7@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: nielsdrost7 <47660417+nielsdrost7@users.noreply.github.com>
* Initial plan

* Fix XSS vulnerability in payment form invoice_number field

Co-authored-by: nielsdrost7 <47660417+nielsdrost7@users.noreply.github.com>

* Add comprehensive XSS vulnerability documentation

Co-authored-by: nielsdrost7 <47660417+nielsdrost7@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: nielsdrost7 <47660417+nielsdrost7@users.noreply.github.com>
Comment out password fields from bypass list.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…1446)

* Initial plan

* Address PR #1439 feedback: sanitization and validation improvements

Co-authored-by: nielsdrost7 <47660417+nielsdrost7@users.noreply.github.com>

* Improve security: use DOMParser for HTML sanitization and load file_security_helper

Co-authored-by: nielsdrost7 <47660417+nielsdrost7@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: nielsdrost7 <47660417+nielsdrost7@users.noreply.github.com>
Replace CodeIgniter's library loader with direct instantiation to ensure each invoice gets a unique QR code. The library loader only instantiates once per request, causing all invoices in a batch to share the same QR code from the first invoice.

Co-authored-by: nielsdrost7 <47660417+nielsdrost7@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix identical QR codes on generated invoices Fix QR code generation for batch invoice processing Feb 9, 2026
Copilot AI requested a review from nielsdrost7 February 9, 2026 18:29
@nielsdrost7 nielsdrost7 requested a review from Copilot February 9, 2026 21:50
@nielsdrost7
Copy link
Copy Markdown
Contributor

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 9, 2026

✅ Actions performed

Full review triggered.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 9, 2026

📝 Walkthrough

Walkthrough

Modified the QR code generation in the invoice helper to directly instantiate the QrCode library instead of using CodeIgniter's framework loader. The function maintains its original behavior of generating a QR code data URI for invoices with non-zero balances.

Changes

Cohort / File(s) Summary
QR Code Library Loading Refactor
application/helpers/invoice_helper.php
Changed QrCode library initialization from framework loader pattern ($CI->load->library()) to direct require_once and object instantiation, simplifying the dependency management in the helper function.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related issues

Poem

🐰 Hop, skip, and a QR code away,
No loader loops to slow the day,
Direct and swift, the invoice flies,
Fresh QR codes before our eyes!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: fixing QR code generation to handle batch invoice processing by replacing the framework's library loader with direct instantiation to ensure each invoice gets a fresh QrCode instance.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch copilot/fix-qr-code-generation-issue

No actionable comments were generated in the recent review. 🎉


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes incorrect QR codes when generating multiple invoices within a single CodeIgniter 3 request by ensuring each call uses a fresh QrCode instance rather than the Loader-cached singleton.

Changes:

  • Replace $CI->load->library('QrCode', [...]) usage with direct QrCode instantiation per invoice.
  • Generate QR code data URI from the newly created instance to avoid parameter reuse across invoices.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nielsdrost7 nielsdrost7 changed the base branch from prep/v170 to prep/v172 February 16, 2026 14:57
@nielsdrost7 nielsdrost7 force-pushed the prep/v172 branch 2 times, most recently from d314f64 to 5b927da Compare April 16, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v1.6.3: QR code identical for all invoices when generated in batch/cron

3 participants