Hur en byrepresentant håller sin orts profil aktuell och synlig på plattformenHow a village representative keeps their location's profile current and visible on the platform
Byadministratören loggar in på samma sida som alla andra roller, med sin e-post och sitt lösenord.
The village administrator logs in on the same page as all other roles, with their email and password.
Efter inloggning hamnar byadministratören på /dashboard/, precis som andra kommunroller. Fliken «Översikt» visar kommunens övergripande siffror (antal entiteter, hävdade profiler, kommande evenemang) — samma vy som en fältagent eller landsbygdsutvecklare ser, inte bara data om den egna byn.
After logging in, the village administrator lands on /dashboard/, just like other commune roles. The «Översikt» (Overview) tab shows commune-wide numbers (entity count, claimed profiles, upcoming events) — the same view a field agent or rural development officer sees, not just data about their own village.
Fliken «Min by» är filtrerad till byadministratörens egen ort — i det här kontot Arnemark. Länken «Visa» ska ta administratören till byns publika sida, och «Visa på karta» öppnar kartan.
Fixat (2026-09-08): «Visa» länkade tidigare till /by/?id=arnemark, en död adress (404). Länken pekar nu på den riktiga publika bysidan, /plats/arnemark/. «Visa på karta» fungerar som väntat.
The «Min by» (My village) tab is filtered to the village administrator’s own location — in this account, Arnemark. The «Visa» (View) link is meant to take the administrator to the village’s public page, and «Visa på karta» opens the map.
Fixed (2026-09-08): «Visa» used to link to /by/?id=arnemark, a dead address (404). The link now points to the real public village page, /plats/arnemark/. «Visa på karta» works as expected.
Den riktiga adressen till byns publika sida är /plats/arnemark/ (nås via menyn BYAR, inte via den trasiga «Visa»-länken). Sidan visar beskrivning, karta, aktörer och en galleriflik — men inte i skrivande stund någon «Redigera»-knapp för den inloggade byadministratören.
The real address for the village’s public page is /plats/arnemark/ (reached via the BYAR menu, not the broken «Visa» link). The page shows a description, map, local actors, and a gallery tab — but as of this writing, no «Redigera» (Edit) button for the logged-in village administrator.
Fliken «Min profil» på dashboarden visar ett formulär med fälten Namn, Tagline, Beskrivning, Kontakt-e-post, Telefon, Webbplats och Öppettider. Formuläret hämtar och sparar data mot /data/entities.json med kontots entitets-id (arnemark) — men Arnemark finns bara som en by i villages.json, inte som en entitet i entities.json. Formuläret laddas därför tomt, och det är oklart vad ett sparat ändringsförsök egentligen skulle påverka. Detta är inte rätt verktyg för att redigera byns profil.
The «Min profil» tab on the dashboard shows a form with fields for Name, Tagline, Description, Contact email, Phone, Website, and Opening hours. The form fetches and saves data against /data/entities.json using the account’s entity ID (arnemark) — but Arnemark only exists as a village in villages.json, not as an entity in entities.json. The form therefore loads empty, and it is unclear what a saved change would actually affect. This is not the right tool for editing the village profile.
/konto/ är den sida som är byggd för att låta byadministratören redigera sin orts profiltext, fakta och kopplade entiteter (se rollkortet ovan). Vysväljaren visar korrekt «Byadministration» som vald vy, men innehållsytan visar istället felmeddelandet «Byn hittades inte pa ditt konto. Logga ut och in igen, eller kontakta admin.» Det här är inte ett tillfälligt fel — det inträffar varje gång och beror på hur kontots by-koppling sparas i sessionen (se rutan nedan). Byadministratören har i praktiken ingen fungerande väg att redigera byns profil just nu.
/konto/ is the page built to let the village administrator edit their location’s profile text, facts, and linked entities (see the role card above). The view selector correctly shows «Byadministration» as the selected view, but the content area instead shows the error message «Byn hittades inte pa ditt konto. Logga ut och in igen, eller kontakta admin.» («The village was not found on your account. Log out and back in, or contact admin.») This is not an intermittent glitch — it happens every time, and stems from how the account’s village link is stored in the session (see the box below). The village administrator currently has no working way to edit the village profile.
Vysväljaren på /konto/ erbjuder bara två alternativ: «Mina sidor» (personlig vy för medlemskap, bokningar och annonser) och «Byadministration» (den trasiga vyn ovan). «Mina sidor» fungerar och visar att kontot inte är medlem i någon förening ännu.
The view selector on /konto/ offers only two options: «Mina sidor» (a personal view for memberships, bookings, and listings) and «Byadministration» (the broken view above). «Mina sidor» works and shows that the account is not yet a member of any association.
Fixat (2026-09-08): Vid inloggning sattes sessionens villageId tidigare enbart från kolumnen village_id i konto-tabellen, som är NULL för det här testkontot. Den by-slug som faktiskt stämmer med villages.json (arnemark) ligger istället i kolumnen entity_id. Åtgärdat i api/auth/login.php (samt api/auth/google-callback.php) genom att falla tillbaka på entity_id när village_id är NULL för roller village/village_admin — samma fallback som dashboardens «Min by»-flik redan använde. api/_helpers.phps hds_require_village_access() uppdaterades att känna igen rollen village_admin (tidigare kollade den bara village), och api/accounts/create.phps bykonto-flöde skapar nu konton med rollen village_admin och by-sluggen i entity_id, i linje med hur resten av koden fungerar. /konto/-editorn laddar och sparar nu byns profil korrekt (verifierat mot detta testkonto).Fixed (2026-09-08): At login, the session’s villageId used to be set purely from the village_id column in the accounts table, which is NULL for this test account. The village slug that actually matches villages.json (arnemark) instead lives in the entity_id column. Fixed in api/auth/login.php (and api/auth/google-callback.php) by falling back to entity_id when village_id is NULL for the village/village_admin roles — the same fallback the dashboard’s «Min by» tab already used. api/_helpers.php’s hds_require_village_access() was updated to recognize the village_admin role (it previously only checked village), and api/accounts/create.php’s village-account flow now creates accounts with the village_admin role and the village slug in entity_id, matching how the rest of the code works. The /konto/ editor now loads and saves the village profile correctly (verified against this test account).