GoteoFoundation / goteo-legacy

Unsupported legacy code for the Crowdfunding Open Source platform Goteo - http://goteo.org/ - Get the new version here: https://github.com/GoteoFoundation/goteo
http://www.goteo.org
Other
234 stars 193 forks source link

Unknown column 'node' in 'field list' (/library/mail.php etc.) #176

Open muzudho opened 8 years ago

muzudho commented 8 years ago

Hi!

I found missing 'node' field on 'mail' table. (from 166 commits source code)

/library/mail.php 205

$sql = "INSERT INTO mail (id, email, html, template, node) VALUES ('', :email, :html, :template, :node)";

perhaps,

/controller/admin/mailing.php 255

$sql = "INSERT INTO mail (id, email, html, template, node) VALUES ('', :email, :html, :template, :node)";

/controller/dashboard/projects.php 317

$sql = "INSERT INTO mail (id, email, html, template, node) VALUES ('', :email, :html, :template, :node)";

Please fix this. :-)

muzudho commented 8 years ago

In my case.

before /controller/admin/mailing.php 255

                $sql = "INSERT INTO mail (id, email, html, template, node) VALUES ('', :email, :html, :template, :node)";
                $values = array (
                    ':email' => 'any',
                    ':html' => $content,
                    ':template' => $templateId,
                    ':node' => $node
                );

after

                $sql = "INSERT INTO mail (id, email, html, template) VALUES ('', :email, :html, :template)";
                $values = array (
                    ':email' => 'any',
                    ':html' => $content,
                    ':template' => $templateId
                );

before /controller/dashboard/projects.php 317

        $sql = "INSERT INTO mail (id, email, html, template, node) VALUES ('', :email, :html, :template, :node)";
        $values = array (
            ':email' => 'any',
            ':html' => $content,
            ':template' => $template->id,
            ':node' => \GOTEO_NODE
        );

after

        $sql = "INSERT INTO mail (id, email, html, template) VALUES ('', :email, :html, :template)";
        $values = array (
            ':email' => 'any',
            ':html' => $content,
            ':template' => $template->id
        );

before /library/mail.php 205

                $sql = "INSERT INTO mail (id, email, html, template, node) VALUES ('', :email, :html, :template, :node)";
                $values = array (
                    ':email' => 'any',
                    ':html' => $this->content,
                    ':template' => $this->template,
                    ':node' => $_SESSION['admin_node']
                );

after

                $sql = "INSERT INTO mail (id, email, html, template) VALUES ('', :email, :html, :template)";
                $values = array (
                    ':email' => 'any',
                    ':html' => $this->content,
                    ':template' => $this->template
                );

:-)