Giter Site home page Giter Site logo

Comments (8)

dskrepps avatar dskrepps commented on August 23, 2024

Was checking this out today and was immediately hit by a screen fulls of errors. After managing to get to settings they went away, so probably the same bug.

Screenshot_2020-11-20_19-29-27

from c9-admin.

Varstahl avatar Varstahl commented on August 23, 2024

Looks like it, yes.

from c9-admin.

covertnine avatar covertnine commented on August 23, 2024

I pushed an update today that I believe addresses this, but I’m having a hard time getting it to error out

I have an issue with the admin bar setting still that I’m going to work out this weekend.

Take a look

f9a5f03

from c9-admin.

Varstahl avatar Varstahl commented on August 23, 2024

From my recollection of things, this issue appears only on new installations and that commit doesn't fix it. The default return value for get_option() is false, so the line would still be evaluated as isset(<bool>['suppress_update_notice']). I would honestly mirror get_option functionality in a class function like so:

function c9_get_option($name) {
    $opt = get_option($this->plugin_name);
    return (((false !== $opt) && array_key_exists($name, $opt)) ? $opt[$name] : false);
}

At that point you could disregard most of the conditionals within your code, and instances like

if ((isset(get_option($this->plugin_name)['suppress_update_notice'])) && (true == get_option($this->plugin_name)['suppress_update_notice'])) {
would just become

if (c9_get_option('suppress_update_notice'))

Also, since mirroring the get_option behaviour, this works even if the return value is not simply true but a complex dataset.

Note: I wrote the code off the top of my head, and while it should work some test might be in order :D

from c9-admin.

covertnine avatar covertnine commented on August 23, 2024

from c9-admin.

dskrepps avatar dskrepps commented on August 23, 2024

Both these solutions fix the errors except for the first, line 41.

If you could change that line in your pull request to the following all errors are gone on my end.

        if (!$this->c9_option('custom_skin')) {

But now I notice the settings page has more of the same errors in c9-admin-display.php.

from c9-admin.

Varstahl avatar Varstahl commented on August 23, 2024

oops, that line eluded me, thanks for reporting.

from c9-admin.

covertnine avatar covertnine commented on August 23, 2024

from c9-admin.

Related Issues (1)

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.