Htmlizer relation and orderBy

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • item
    Active Community Member
    • Mar 2017
    • 1476

    Htmlizer relation and orderBy

    Hello,
    espoCRM 6.1.9

    Htmlizer, print-to-pdf, when fetch related data '{{#each '.$relation.'}}' , don't respect orderBy in metadat entityDefs
    in older version, orderBy is respected.
    I think, it's in this function.

    sorry if not bug

    PHP Code:
    foreach ($relationList as $relation) {
    $collection = null;
    
    if ($entity->hasLinkMultipleField($relation)) {
    $toLoad = true;
    
    $collection = $this->entityManager
    ->getRepository($entity->getEntityType())
    ->getRelation($entity, $relation)
    ->find();
    } else {
    if (
    $template && $entity->getRelationType($relation, ['hasMany', 'manyMany', 'hasChildren']) &&
    mb_stripos($template, '{{#each '.$relation.'}}') !== false
    ) {
    $limit = 100;
    if ($this->config) {
    $limit = $this->config->get('htmlizerLinkLimit') ?? $limit;
    }
    
    $collection = $this->entityManager
    ->getRepository($entity->getEntityType())
    ->getRelation($entity, $relation)
    ->limit(0, $limit)
    ->find();
    }
    }
    
    if ($collection) {
    $data[$relation] = $collection;
    }
    } 
    
    If you could give the project a star on GitHub. EspoCrm believe our work truly deserves more recognition. Thanks.​
  • yuri
    Member
    • Mar 2014
    • 8453

    #2
    Already fixed in the master branch.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    Working...