I'm looking at the
modules/mod_flexicontent/helper.php
I will post my proposed changes in a while, but they will be minor and concern some features I need.
I have 2 suggestions:
1. There is a number of lines of the same code for featured and standart items. The difference is only in the
_feat suffix. Altering such a code demands twice changins.
My suggestions is to move it to a function to call it with the suffix parameter -
_feat or no. We can reduce the number of the code lines sugnificantly.
I can rewrite this, but I need to be sure it will be applied in the next buiilds.
2. When I want to show items's fields in the module
it requests firstly ALL the availabe fields here:
Code:
$rows = & FlexicontentFields::getFields($filtered_rows, 'module', $params);
and later removes unneded. Is thir correct? Isn't it an overload? I'm not familiar with the code yet, but I think it would be better to create a function to fetch a field or a set of fields, but not all the universe of the fields. Function
FlexicontentFields::getFields is a heavy one to be used in the module, as for me.
Maybe it's worth to create another function for frontend, much lighter.
But in this point I'm not sure. Maybe the data is loaded anyway on some other reason. This can tell someone more familiar with the code.
Still I can help with the code ecnhacement, but I must be sure I understand the logic in a right way not to make mistakes.