censusbv / DitsNews

MODx Revolution Newsletter component
10 stars 5 forks source link

Database Tables not created in 2.1rc3 #7

Closed exside closed 13 years ago

exside commented 13 years ago

Something with the database table installation seems not to be alright anymore in Revo 2.1rc3...

I used DitsNews with 2.0.8pl and there it worked (not via package management which throws an Error ("can't download package" or something like that) but manually installed it works)...I digged a bit into it, added the ditsnews-db-tables manually (the old ones from the 2.0.8 installation), now it works also in 2.1rc3. Don't know why it can't create the tables in 2.1rc3, any ideas?

I also had another issue which forced me to hack around in the ditsnews.class.php after line 63

    public function queueMessages($newsletterId, $documentId, $groups) {
        // xodmod: file_get_contents replacement
        function file_get_contents_curl($url) {
            $ch = curl_init();

            curl_setopt($ch, CURLOPT_HEADER, 0);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Set curl to return the data instead of printing it to the browser.
            curl_setopt($ch, CURLOPT_URL, $url);

            $data = curl_exec($ch);
            curl_close($ch);

            return $data;
        }

// some other code left out....

        //$message = file_get_contents( $docUrl );
        // xodmod: replace the function
        $message = file_get_contents_curl($docUrl);

This had to be because my server doesn't allow the file_get_contents() function so I had to replace it with a cURL function that does the same...maybe you want to add a check if file_get_contents() is available and if not add my function into your class...

keep up the great work!

markschl commented 13 years ago

Have the same issue (no tables created, no settings are kept) with 2.0.7pl on a webserver (PHP 5.3.3-7, Mysql 5.0.32) as well as with 2.1rc4 on a local setup (PHP 5.3.5, Mysql 5.1.54-1). Where could I evenutally find information on which tables to create manually? Thanks!

exside commented 13 years ago

You would find the mysql xpdo schema in core/components/ditsnews/model/schema/ditsnews.mysql.schema.xml but if you are not very deep in this xpdo stuff (like myself) it won't be very helpful =)...I exported my existing tables, removed the INSERT parts with the data (hope it still works, but you will see the necessary tables anyway) and uploaded it here: http://upload.exside.ch/ditsnews_tables.sql

hope it helps =)

markschl commented 13 years ago

Thanks a lot for your fast reply! Unfortunately I still get errors using this table, e.g. [2011-05-12 18:52:05](ERROR @ /assets/components/ditsnews/connector.php) dnSubscriber: Attempt to set NOT NULL field firstname to NULL Setting these fields to NULL didn't help for some reason, I don't know much about Mysql. Anyway, I'll wait... I hope these issues get fixed soon.

[[[ Slightly off-topic: Does anyone know, whether there is an upper limit for the number of emails? ]]]

censusbv commented 13 years ago

Should be fixed in 0.2.0 alpha 1.