Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto Apto para principiantes
#1,014 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
72/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
laravel, php
Área
backend

Línea de trabajo

Compara app/Functions/functions.php en v4.8.6 y v4.8.7 y, después, lee sus puntos de llamada en resources/views/linkstack/elements/buttons.blade.php y app/Http/Controllers/LinkTypeViewController.php. Restaura o sustituye los seis helpers de bloque que faltan de forma coherente con esos puntos de llamada. Comprueba que, después de actualizar, funcionan tanto un perfil existente con bloques custom_html como la interfaz de edición de bloques.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
PHP
Estrellas
3.9k
Forks
440
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de LinkStackOrg/LinkStack

Todos los issues de LinkStackOrg/LinkStack

Issues similares

Más issues de PHP

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.