Skip to content

Commit

Permalink
Merge pull request #1 from mitydigital/feature/24sep12-updates
Browse files Browse the repository at this point in the history
Updates 12th September 2024
  • Loading branch information
martyf authored Sep 13, 2024
2 parents caa24de + 2fd4f41 commit f13a55c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 8 additions & 2 deletions src/Support/FuseUtilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Statamic\Facades\GlobalSet;
use Statamic\Facades\Site;
use Statamic\Forms\Form;

class FuseUtilities
{
Expand All @@ -12,7 +13,7 @@ public function getImagesMissingAltCache(): string
return 'fuse-utilities::widgets.images-without-alt';
}

public function isCaptchaEnabled(?string $site = null, ?string $environment = null, ?string $form = null): bool
public function isCaptchaEnabled(?string $site = null, ?string $environment = null, Form|string $form = null): bool
{
$forms = GlobalSet::findByHandle('forms')
->in($site ?? Site::current()->handle);
Expand All @@ -23,7 +24,12 @@ public function isCaptchaEnabled(?string $site = null, ?string $environment = nu
if ($enabled && $form) {
$excludedForms = $forms->get('excluded_forms', []);

if (in_array($form, $excludedForms)) {
$handle = $form;
if (is_object($form) && get_class($form) === Form::class) {
$handle = $form->handle();
}

if (in_array($handle, $excludedForms)) {
return false;
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/Tags/Concerns/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public function image()
// load the asset
$asset = AssetAPI::find($asset);

//dd(get_class_methods($asset));
$data = [
...$asset->toAugmentedArray(),
'formats' => [
Expand Down Expand Up @@ -127,7 +126,6 @@ public function image()
//
$aspectRatios = collect(explode(' ', trim($this->getParamOrContext('aspect_ratio'))))
->mapWithKeys(function (string $ratio) {
ray($ratio);
if (Str::substrCount($ratio, '/') === 1) {
$ratio = Str::trim($ratio);
$prefix = 'base';
Expand Down

0 comments on commit f13a55c

Please sign in to comment.