Skip to content

Commit

Permalink
Merge pull request #1870 from tomudding/fix/job-attachments-always-shown
Browse files Browse the repository at this point in the history
fix(company): localised text comparisons expecting null instead of empty string
  • Loading branch information
tomudding authored Jul 23, 2024
2 parents 85c3ea9 + a2beb49 commit 8ecd310
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
4 changes: 2 additions & 2 deletions module/Company/view/company/company/job-list.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ $this->headScript()
<?= $this->escapeHtml($this->localiseText($job->getName())) ?>
</h2>
<p class="card-subtitle text-muted"><?= $this->escapeHtml($company->getName()) ?></p>
<?php if (null !== $this->localiseText($job->getLocation())): ?>
<?php if ('' !== ($location = $this->localiseText($job->getLocation()))): ?>
<p class="job-location">
<?= $this->escapeHtml($this->localiseText($job->getLocation())) ?>
<?= $this->escapeHtml($location) ?>
</p>
<?php endif; ?>
<div>
Expand Down
8 changes: 4 additions & 4 deletions module/Company/view/company/company/jobs.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -120,16 +120,16 @@ $this->headScript()
</a>
</p>
<?php endif; ?>
<?php if (null !== $this->localiseText($job->getWebsite())): ?>
<?php if ('' !== ($website = $this->localiseText($job->getWebsite()))): ?>
<p class="job-website">
<a href="<?= $this->localiseText($job->getWebsite()) ?>" rel="noreferrer">
<a href="<?= $website ?>" rel="noreferrer">
<?= $this->translate('View Website') ?>
</a>
</p>
<?php endif; ?>
<?php if (null !== $this->localiseText($job->getAttachment())): ?>
<?php if ('' !== ($attachment = $this->localiseText($job->getAttachment()))): ?>
<p class="job-vacancy">
<a href="<?= $this->fileUrl($this->localiseText($job->getAttachment())) ?>">
<a href="<?= $this->fileUrl($attachment) ?>">
<?= $this->translate('View Attachment') ?>
</a>
</p>
Expand Down
10 changes: 3 additions & 7 deletions module/Company/view/partial/company/company/list/company.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,9 @@ $companyURL = $escaper->escapeHtmlAttr($this->localiseText($company->getWebsite(
<div class="col-md-12">
<h1 class="company-name">
<a href="<?= $companyURL ?>"><?= $this->escapeHtml($company->getName()) ?></a>
<?php
if (null !== $this->localiseText($company->getSlogan())):
?>
<small>&#124; <?= $this->escapeHtml($this->localiseText($company->getSlogan())) ?></small>
<?php
endif;
?>
<?php if ('' !== ($slogan = $this->localiseText($company->getSlogan()))): ?>
<small>&#124; <?= $this->escapeHtml($slogan) ?></small>
<?php endif; ?>
</h1>
</div>
<div class="col-md-3">
Expand Down

0 comments on commit 8ecd310

Please sign in to comment.