Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

[Bug] v4.8.7: Missing block helper functions cause HTTP 500 after upgrading from v4.8.6

Ouverte Adaptée aux débutants
#1,014 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
2/5
Temps estimé
1-3 heures
Accessibilité débutants
72/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
laravel, php
Domaine
backend

Piste de recherche

Comparez app/Functions/functions.php dans les versions v4.8.6 et v4.8.7, puis lisez ses appelants dans resources/views/linkstack/elements/buttons.blade.php et app/Http/Controllers/LinkTypeViewController.php. Restaurez ou remplacez les six helpers de bloc manquants de manière cohérente avec ces appelants. Vérifiez qu’après la mise à niveau, un profil existant avec des blocs custom_html et l’interface de modification des blocs fonctionnent tous les deux.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

LinkStack version

4.8.7

Description

After upgrading from v4.8.6 to v4.8.7 using the built-in updater, my existing LinkStack instance returns HTTP 500. The updater reached its success page, but the public profile no longer loads.

The Laravel log reports:

Call to undefined function setBlockAssetContext()
at /htdocs/storage/framework/views/b7d603e7af4f1b916ac46071eaaeeb199ff25572.php:14

Findings

The official release archive was downloaded and inspected:
https://github.com/LinkStackOrg/LinkStack/releases/download/v4.8.7/linkstack.zip

It contains calls to setBlockAssetContext() in:

  • resources/views/linkstack/elements/buttons.blade.php, line 14
  • app/Http/Controllers/LinkTypeViewController.php, line 51

However, no definition of this function was found in the PHP files in the archive.

Compared with the v4.8.6 source, the following block helpers are missing from app/Functions/functions.php in v4.8.7:

  • setBlockAssetContext
  • block_asset
  • get_block_file_contents
  • block_text_translation_check
  • block_text
  • bt

The v4.8.7 edit-link view also still calls block_text_translation_check() and bt().

Steps to reproduce

  1. Start with an existing v4.8.6 installation whose profile contains blocks rendered through the custom_html branch of buttons.blade.php.
  2. Upgrade to v4.8.7 using the built-in updater.
  3. Open the public profile.
  4. Observe HTTP 500 and the undefined-function exception.

Troubleshooting performed

  • Confirmed that the container is using the intended bind-mounted application directory.
  • Successfully ran php artisan view:clear.
  • Retested directly inside the container, bypassing Traefik:
curl -sS --max-time 10 -o /dev/null -w 'HTTP %{http_code}\n' http://localhost

Result: HTTP 500. The same undefined-function exception persists.

The failing HTTP response causes the Docker healthcheck to mark the container unhealthy. The instance then disappears from Traefik's routing configuration, resulting in an external 404.

Expected behavior

Existing profiles and block editing should continue working after the update, with all required helper functions available.

I am rolling back to v4.8.6 from backup to restore service. Could you please check whether these helpers were accidentally omitted from v4.8.7?

Details about your system
  • Deployment: Docker Compose on a Linux host
  • Image: linkstackorg/linkstack:latest
  • LinkStack upgrade: v4.8.6 → v4.8.7 via the built-in updater
  • PHP: 8.3.29
  • Apache: 2.4.66
  • Reverse proxy: Traefik 3.7.10
  • Persistent storage: host directory bind-mounted to /htdocs
  • Docker healthcheck: curl -fsS --max-time 5 http://localhost/ -A 'HealthCheck' >/dev/null || exit 1
  • Healthcheck result after upgrade: HTTP 500 / unhealthy
How to reproduce
  1. Start with a working v4.8.6 installation containing blocks rendered through the custom_html branch of resources/views/linkstack/elements/buttons.blade.php.
  2. Upgrade to v4.8.7 using the built-in updater.
  3. Open the public profile.
  4. The request returns HTTP 500, and the Laravel log reports:
    Call to undefined function setBlockAssetContext().
  5. Run php artisan view:clear and reload. The same error persists.

The error also occurs when requesting http://localhost/ directly inside the container, bypassing the reverse proxy.

Inspecting the official v4.8.7 release ZIP shows calls to setBlockAssetContext() in the controller and Blade template, but no corresponding function definition in the included PHP files.

Possible Solution

Please review the changes to app/Functions/functions.php between v4.8.6 and v4.8.7 and restore or replace the missing block helpers consistently with their callers:

  • setBlockAssetContext
  • block_asset
  • get_block_file_contents
  • block_text_translation_check
  • block_text
  • bt

The public profile still calls setBlockAssetContext(), while the edit-link view still calls block_text_translation_check() and bt().

A corrected release should be tested against both an existing profile containing blocks and the block editing interface. Clearing the compiled views alone does not resolve the issue.

This is a proposed fix based on the source comparison; I have not applied or verified a patch.

Additional Context

Inspected release archive:
https://github.com/LinkStackOrg/LinkStack/releases/download/v4.8.7/linkstack.zip

SHA-256 of the inspected archive:
880b144372b0c7adf253a921c7c124de799505396c7a814ec76e6290a9d02108

The container's bind mount was verified against the host directory using inode numbers, ruling out an accidentally mounted alternative directory at the time of testing.

The internal HTTP 500 causes the Docker healthcheck to fail. The container becomes unhealthy and disappears from Traefik's routing configuration, producing an external 404. The PHP exception is therefore the primary finding.

I am rolling back to v4.8.6 from backup while awaiting a corrected release.

Langage dominant
PHP
Étoiles
3.9k
Forks
440
Métriques de merge des PR
Aucune PR mergée en 30 j

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de LinkStackOrg/LinkStack

Toutes les issues de LinkStackOrg/LinkStack

Issues similaires

Plus d'issues PHP

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.