Skip to content

Send email show blank page (invoice/quote) #1196

@sudwebdesign

Description

@sudwebdesign

When click send an email Make a php fatal error (or blank page in prod. mode)

Expected Behavior

After send email show invoice(s list) (or quote)

Current Behavior

After send make blank page

Solution

Remove #[AllowDynamicProperties]
in application/modules/mailer/helpers/phpmailer_helper.php

Steps to Reproduce

  1. Go to invoices/status/all
  2. Click on options of one invoice and choose Send Email
  3. In Page mailer/invoice/#number# complete fields (or not)
  4. Click on Send button

Context (Environment)

Affect development branch and v1.6.2 if PHP 8 >= 8.2.0

Failure Logs

Fatal error:  Attribute "AllowDynamicProperties" cannot target function (allowed targets: class) 
in /var/www/ip/application/modules/mailer/helpers/phpmailer_helper.php on line 16, 
referer: http://localhost/ip/index.php/mailer/invoice/3

Stack trace:, referer: http://localhost/ip/index.php/mailer/invoice/3
  1. {main}() /var/www/ip/index.php:0, referer: http://localhost/ip/index.php/mailer/invoice/3
  2. require_once() /var/www/ip/index.php:329, referer: http://localhost/ip/index.php/mailer/invoice/3
  3. Mailer->send_invoice($invoice_id = '3') /var/www/ip/vendor/codeigniter/framework/system/core/CodeIgniter.php:533, referer: http://localhost/ip/index.php/mailer/invoice/3
  4. email_invoice($invoice_id = '3', $invoice_template = 'InvoicePlane', $from = [0 => 'my@mail.com', 1 => 'me'], $to = 'addresse@email.dev', $subject = 'Facture #3', $body = 'yep {{{client_surname}}}{{{client_name}}}<br />\\r\\nsending by {{{user_company}}} ({{{user_name}}})<br />\\r\\ninvoice number {{{invoice_number}}} ({{{invoice_status}}})', $cc = '', $bcc = '', $attachments = []) /var/www/ip/application/modules/mailer/controllers/Mailer.php:165, referer: http://localhost/ip/index.php/mailer/invoice/3
  5. MX_Loader->helper($helper = 'mailer/phpmailer') /var/www/ip/application/helpers/mailer_helper.php:58, referer: http://localhost/ip/index.php/mailer/invoice/3
  6. Modules::load_file($file = 'phpmailer_helper', $path = '/var/www/ip/application/modules/mailer/helpers/', $type = *uninitialized*, $result = *uninitialized*) /var/www/ip/application/third_party/MX/Loader.php:347, referer: http://localhost/ip/index.php/mailer/invoice/3

Note

AllowDynamicProperties it's only for Object ;-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions