Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions ProcessMaker/Models/Setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,16 @@ public function notHiddenGroups($query, $filter)
*/
public static function loginIsDefault()
{
return stripos(self::getLogin(), 'processmaker-login') !== false;
$setting = self::byKey('css-override');

if ($setting instanceof self) {
$mediaFile = $setting->getMedia(self::COLLECTION_CSS_LOGIN);
if ($mediaFile->count() > 0) {
return false;
}
}

return true;
}

/**
Expand All @@ -320,10 +329,11 @@ public static function getLogin()

foreach ($mediaFile as $media) {
$url = $media->getFullUrl();
return $url . '?id=' . $media->updated_at->timestamp;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale logo after re-upload

High Severity

Returning inside the getMedia loop selects the first collection item. Customize UI appends a new media row on every upload and Spatie orders by order_column ascending, so a replacement keeps the original file URL and updated_at cache key. Browsers then keep serving the old cached login logo, favicon, icon, or sidebar logo.

Additional Locations (3)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 355efdb. Configure here.

}
}

return $url . '?id=' . bin2hex(random_bytes(16));
return $url;
}

/**
Expand All @@ -344,6 +354,7 @@ public static function getLogo()

foreach ($mediaFile as $media) {
$url = $media->getFullUrl();
return $url . '?id=' . $media->updated_at->timestamp;
}
}
}
Expand All @@ -369,11 +380,12 @@ public static function getIcon()

foreach ($mediaFile as $media) {
$url = $media->getFullUrl();
return $url . '?id=' . $media->updated_at->timestamp;
}
}
}

return $url . '?id=' . bin2hex(random_bytes(16));
return $url;
}

/**
Expand All @@ -394,11 +406,12 @@ public static function getFavicon()

foreach ($mediaFile as $media) {
$url = $media->getFullUrl();
return $url . '?id=' . $media->updated_at->timestamp;
}
}
}

return $url . '?id=' . bin2hex(random_bytes(16));
return $url;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion resources/views/auth/newLogin.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class="login-remember-input"
</div>
@endif
</div>
</div>
</div>
@php
$loginFooterSetting = \ProcessMaker\Models\Setting::byKey('login-footer');
@endphp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
@endif
@endforeach
<script>
window.ProcessMaker = window.ProcessMaker || {};
window.ProcessMaker.packages = @json(\App::make(ProcessMaker\Managers\PackageManager::class)->listPackages());
document.addEventListener('DOMContentLoaded', function() {
window.ProcessMaker = window.ProcessMaker || {};
window.ProcessMaker.packages = @json(\App::make(ProcessMaker\Managers\PackageManager::class)->listPackages());
});
</script>
<script src="{{ mix('js/translations/index.js') }}"></script>
<script src="{{ mix('js/translations/index.js') }}" defer></script>
6 changes: 3 additions & 3 deletions resources/views/auth/partials/auth-language-scripts.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script src="{{ mix('builds/login/js/manifest.js') }}"></script>
<script src="{{ mix('builds/login/js/vendor.js') }}"></script>
<script src="{{ mix('builds/login/js/app-login.js') }}"></script>
<script src="{{ mix('builds/login/js/manifest.js') }}" defer></script>
<script src="{{ mix('builds/login/js/vendor.js') }}" defer></script>
<script src="{{ mix('builds/login/js/app-login.js') }}" defer></script>
@include('auth.partials.auth-language-scripts-minimal')
26 changes: 26 additions & 0 deletions resources/views/auth/partials/auth-styles.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,32 @@
color: #51585E;
}

.password-toggle-btn {
display: inline-flex;
align-items: center;
justify-content: center;
position: absolute;
top: 50%;
right: 1rem;
transform: translateY(-50%);
padding: 0;
border: 0;
background: transparent;
color: #51585E;
cursor: pointer;
line-height: 0;
}

.password-toggle-btn svg {
width: 18px;
height: 18px;
display: block;
}

.password-toggle-btn svg[hidden] {
display: none;
}

.password-container {
position: relative;
}
Expand Down
2 changes: 1 addition & 1 deletion resources/views/components/logo.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
$class = 'login-logo-custom';
}
@endphp
<img src={{$loginLogo}} alt="{{ config('logo-alt-text', 'ProcessMaker') }}" class="{{ $class }}">
<img src="{{ $loginLogo }}" alt="{{ config('logo-alt-text', 'ProcessMaker') }}" class="{{ $class }}" fetchpriority="high" {!! $isDefault ? 'width="440" style="height: auto;"' : 'style="max-width: 100%; height: auto;"' !!}>
1 change: 1 addition & 0 deletions webpack.mix.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ mix
.sass("resources/sass/sidebar/sidebar.scss", "public/css")
.sass("resources/sass/collapseDetails.scss", "public/css")
.sass("resources/sass/app.scss", "public/css")
.minify("public/css/app.css")
.postCss("resources/sass/tailwind.css", "public/css", [
require("tailwindcss"),
])
Expand Down
Loading