fix: add https:// to company_websites URLs and ensure_url in contact bar
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions

- Migration 064 fixes 12 records in company_websites table missing https://
- Added ensure_url filter to w.url in contact bar template as safety net

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Maciej Pienczyn 2026-02-21 19:38:39 +01:00
parent b6d9fb7382
commit b187b0fc4a
2 changed files with 10 additions and 1 deletions

View File

@ -0,0 +1,9 @@
-- Migration 064: Fix company_websites URLs missing https:// prefix
-- 12 records have URLs without http/https scheme, causing relative link issues
UPDATE company_websites
SET url = 'https://' || url
WHERE url IS NOT NULL
AND url != ''
AND url NOT LIKE 'http://%'
AND url NOT LIKE 'https://%';

View File

@ -989,7 +989,7 @@
{% if company.websites %}
{% for w in company.websites %}
{% set cfg = wtype_config.get(w.website_type or 'website', wtype_config['website']) %}
<a href="{{ w.url }}" class="contact-bar-item contact-bar-website" target="_blank" rel="noopener noreferrer"
<a href="{{ w.url|ensure_url }}" class="contact-bar-item contact-bar-website" target="_blank" rel="noopener noreferrer"
style="--wb-color: {{ cfg.color }};"
title="{{ w.label ~ ' — ' ~ w.url|replace('https://', '')|replace('http://', '')|replace('www.', '') if w.label else cfg.tooltip ~ ' — ' ~ w.url|replace('https://', '')|replace('http://', '')|replace('www.', '') }}">
{% if cfg.icon == 'cart' %}