Category: Magento 2

Magento 2 Developer Extensions Wall of Shame

This Hall of shame will act as a warning system for Magento 2 developers to help avoid bad quality extensions. If an extension of bad quality is produced the developer brand will be shown here.

  1. Mageworx
  2. MagePlaza
  3. Magecomp

 

MageWorx Multifees

Untested code.

Here is the code to add the isRequired Filter:

public function addRequiredFilter($isRequired = true)
{
    if ($isRequired) {
        $this->getSelect()->where('main_table.required = ?', Fee::REQUIRED);
    }
    return $this;
}

But the Fee::REQUIRED constant is: a string

const FEE_ID                   = 'fee_id';
const TYPE                     = 'type';
const INPUT_TYPE               = 'input_type';
const IS_ONETIME               = 'is_onetime';
const REQUIRED                 = '1';
const SALES_METHODS            = 'sales_methods';
const APPLIED_TOTALS           = 'applied_totals';
const TAX_CLASS_ID             = 'tax_class_id';
const CONDITIONS_SERIALIZED    = 'conditions_serialized';
const ENABLE_CUSTOMER_MESSAGE  = 'enable_customer_message';
const ENABLE_DATA_FIELD        = 'enable_date_field';
const TOTAL_ORDERED            = 'total_ordered';
const TOTAL_BASE_AMOUNT        = 'total_base_amount';
const SORT_ORDER               = 'sort_order';
const STATUS                   = 'status';

Forming a query that checks where the field is required instead of 1

Mage Plaza – Layered Navigaiton

Breaks layered navigation with elasticsearch and allows multiple attributes with an AND when it should only be a single

 

MageComp_Recaptcha

Horrific rewrites and module does not work at all.

Incompetent developers.

Magento 2 Error Cannot redeclare class

So I was creating a module when I received this error. I had just enabled it and done the setup upgrade in Magento 2.

The error is:


2017/03/01 11:11:11 [error] 17788#17788: *101 FastCGI sent in stderr: "PHP message: PHP Fatal 
error:  Cannot declare class Magento\CatalogImportExport\Model\Import\Product\Validator\Media, 
because the name is already in use in 
/var/www/shootingstuff/project/app/code/Tangent/ImportAdditionalImagesDelimiter/Media.php on line 
11

So I googled it and alan storm seems to suggest it may be a spelling mistake

So I checked it out and found that in my case there was no spelling mistake.

Remember this info after enabling your module:


To make sure that the enabled modules are properly registered, run 'setup:upgrade'.
Cache cleared successfully.
Generated classes cleared successfully. Please run the 'setup:di:compile' command to generate classes.
Info: Some modules might require static view files to be cleared. To do this, run 'module:enable' with the --clear-static-content option to clear them.

So remove your var/generation¬†folder…or maybe it does this automatically when you run: bin/magento setup:di:compile

 

Unfortunately this didn’t fix my issue but it is probably goign to solve yours.

The issue in my case

The issue in my case was caused by my laziness.

I had just copied the contents of the core magento file into my module and changed the part I needed to.

I forgot the namespace. The namespace was using the magento one. So changed it to:

 

namespace <MyVendor>\<MyModule>;