Coder Social home page Coder Social logo

Comments (6)

tyrant88 avatar tyrant88 commented on June 21, 2024

Ja, da bringt 5.13 ein Problem, da muss ich mal mit @gharlan schnacken...

from search_it.

tyrant88 avatar tyrant88 commented on June 21, 2024

rex_exception thrown with message "Calling getPath on rex_null_package is not allowed"

Stacktrace:
#9 rex_exception in D:\weblocal\redaxo\redaxo\src\core\lib\packages\null.php:50
#8 rex_null_package:getPath in D:\weblocal\redaxo\redaxo\src\addons.new.search_it\update.php:10
#7 include in D:\weblocal\redaxo\redaxo\src\core\lib\packages\package.php:285
#6 rex_package:includeFile in D:\weblocal\redaxo\redaxo\src\addons\install\lib\package\package_update.php:63
#5 rex_install_package_update:doAction in D:\weblocal\redaxo\redaxo\src\addons\install\lib\package\package_download.php:44
#4 rex_install_package_download:run in D:\weblocal\redaxo\redaxo\src\addons\install\lib\api\api_package_update.php:21
#3 rex_api_install_package_update:execute in D:\weblocal\redaxo\redaxo\src\core\lib\api_function.php:180
#2 rex_api_function:handleCall in D:\weblocal\redaxo\redaxo\src\core\backend.php:234
#1 require in D:\weblocal\redaxo\redaxo\src\core\boot.php:143
#0 require in D:\weblocal\redaxo\redaxo\index.php:9

from search_it.

gharlan avatar gharlan commented on June 21, 2024

Der Fehler kommt also aus dieser Zeile:

if ( is_dir($addon->getPlugin('reindex')->getPath()) ) {

Wenn das Plugin bereits nicht mehr existiert, ruft man dort getPath auf zu einer Instanz von rex_null_package (ein nicht existierendes Package).
Da hatte REDAXO bisher null geliefert.
Eigentlich sollte man aber bei einem nicht existierenden Package gar nicht mit den Pfaden hantieren. Vor allem wenn man nicht weiß, ob ein package oder null-package vorliegt, ist es tendenziell problematisch mit getPath zu arbeite (man denke an sowas wie $package->getPath().'/foo', wo man dann plötzlich im Root /foo landen würde).

Bei dir ist die Zeile eigentlich aber so unproblematisch. Bin daher am überlegen, ob ich die Änderung in 5.13 rückgängig mache. Eigentlich ist die Exception aus obigen Grund mir aber sehr recht dort.
Mit PHP 8.1 wird die Zeile auch bei der bisherigen Variante eine Deprecated-Meldung erzeugen: https://3v4l.org/DWVo2
Daher wirst du die Zeile sowieso anpassen müssen. Daher wäre es ok, wenn wir die Exception drin lassen und du die Zeile anpasst?
Vorschlag:

if ($addon->pluginExists('reindex')) {
    rex_dir::delete(...);

from search_it.

tyrant88 avatar tyrant88 commented on June 21, 2024

Kein Problem.

Ich bin beim Selbst-Debuggen nicht vorwärts gekommen, weil bei mir der stacktrace (grafischer Teil) so aussah:..
Zwischenablage-1

Edit:
Klar logisch, die Datei ist ja wieder weg... Deshalb sah der include-Aufruf auch korrekt aus... und da stand die update.php... dann hätte ich dort in die Zeile schauen können...
[Selbstgespräch Ende]

from search_it.

tyrant88 avatar tyrant88 commented on June 21, 2024

Neues release --> bitte testen @olien

from search_it.

olien avatar olien commented on June 21, 2024

Klappt. Danke!

from search_it.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.