GithubHelp home page GithubHelp logo

500 Error with Tags about selfoss HOT 9 CLOSED

fossar avatar fossar commented on July 17, 2024
500 Error with Tags

from selfoss.

Comments (9)

tobalsan avatar tobalsan commented on July 17, 2024

tags definitely aren't working

going to http://my.ho.st/tags returns a blank page. No error message at all, even in debug mode.

from selfoss.

SSilence avatar SSilence commented on July 17, 2024

Thats a really strange error. It seems the $this->view is not available. But in the constructor of the parent class (BaseController) it will be instantiated. What happens if you add
$this->view = new \helpers\View();
between the $html and foreach?

from selfoss.

tobalsan avatar tobalsan commented on July 17, 2024

In tags controller:

/**
     * returns all tags
     *
     * @return void
     */
    public function renderTags($tags) {
        $html = "";
        $this->view = new \helpers\View();
        foreach($tags as $tag) {
            $this->view->tag = $tag['tag'];
            $this->view->color = $tag['color'];
            $html .= $this->view->render('templates/tag.phtml');
        }

        return $html;
    }

still no luck (same blank page, no error log)

i tested it on php5.4 and 5.3 btw

from selfoss.

vincebusam avatar vincebusam commented on July 17, 2024

When I try that, I get two sets of tags on the home page, one where they look like they should go, and another on the very upper-left side disrupting the layout. Using Chrome.
Screen Shot 2013-03-15 at 11 34 40 AM

from selfoss.

vincebusam avatar vincebusam commented on July 17, 2024

For some reason, the framework was calling tags() twice, libs/f3/base.php:1147 and libs/f3/base.php:1164. Here's a hack to make it only return once.

    /**
     * returns all tags
     *
     * @return void
     */
    public function renderTags($tags) {
        $html = "";
        if (!$this->view) {
            $this->view = new \helpers\View();  
            return $html;
        }
        foreach($tags as $tag) {
            $this->view->tag = $tag['tag'];
            $this->view->color = $tag['color'];
            $html .= $this->view->render('templates/tag.phtml');
        }

        return $html;
    }

from selfoss.

SSilence avatar SSilence commented on July 17, 2024

I don't have an idea why this happens. When you watch your network communication, how often will be the tag refresh be executed?

Tag and Source refresh was changed yesterday. Can you retest this issue?

Do you have a special server configuration?

from selfoss.

vincebusam avatar vincebusam commented on July 17, 2024

No luck. This is with PHP 5.3.2, stock Ubuntu 10.04 install.
Looking deeper into the backtrace, it happens when it's initializing the Tags Controller, even though the backtrace says it's calling ->tags(). Certainly very strange.

        $tagsController = new \controllers\Tags();

from selfoss.

SSilence avatar SSilence commented on July 17, 2024

Waaahh, I think I found the bug. Please test the newest version from master branch.

The name of the controller class Tags was the same as one function. The first letter of the function was lowercase but on some systems the function was interpreted as constructor. This constructor overwrites the constructor of the parent class which instantiates the view object. Crazy bug, I'm not sure why this happens on some systems and on others not.

Please reopen if problem still exists.

from selfoss.

vincebusam avatar vincebusam commented on July 17, 2024

That fixes it for me. Thanks!

from selfoss.

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.