Announcement

Collapse
No announcement yet.

Htmlizer relation and orderBy

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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;
    }


  • #2
    Already fixed in the master branch.

    Comment

    Working...
    X