Skip to content

Reference to wrong / non-existing class #11581

Closed
@tzyganu

Description

@tzyganu

Preconditions

  1. Magento version 2.2 (or previous)

Steps to reproduce

  1. In the method Magento\Sales\Model\Order\Pdf\Invoice::getPdf comment out the call to $this->insertOrder(
  2. Go to the backend and print an invoice

Expected result

  1. I should see the invoice without the order details

Actual result

  1. I get a fatal error because the class Zend_Pdf_Color_RGB is not found in the _drawHeader method.

Additional info

This happens because the actual class name is Zend_Pdf_Color_Rgb (lowercase g and b).
The fact that it works is just an accident. It's because that's how the php autoloader works. The correct class name is referenced in a method called above the _drawHeader and the correct file is found. The second time the class is called the class is already loaded and since the class names are not case sensitive .... you get where this is going.

Same goes for creditmemo and shipping print. I guess copy/paste.

Metadata

Metadata

Assignees

Labels

Issue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.1.xThe issue has been reproduced on latest 2.1 releaseReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions