Code Monkey home page Code Monkey logo

Comments (23)

nitriques avatar nitriques commented on May 22, 2024

Which version of Symphony ? Which version of PHP ?

from mailchimp.

finferflu avatar finferflu commented on May 22, 2024

Sorry, I forgot to include these important details:

Symphony version: 2.3.1
PHP version: 5.6.2 and 5.3.29 (I tried both of these through MAMP).

from mailchimp.

nitriques avatar nitriques commented on May 22, 2024

Symphony 2.3.1 won't work with 5.6.x (so use 5.3.29 instead)

saveConfig has been renamed to write A LONG TIME AGO and it looks like nobody ever uninstall this extension. (a fix is on its way...)

Finally, AFAICT, the only fwrite call in Symphony is this one: https://github.com/symphonycms/symphony-2/blob/2.3.1/symphony/lib/toolkit/class.general.php#L837

How can $handle be boolean blows my mind...

Maybe try to replace it with

if (!($handle = fopen($file, $mode))) {

?

from mailchimp.

nitriques avatar nitriques commented on May 22, 2024

2.1.1 is out with the saveConfig fix...

from mailchimp.

finferflu avatar finferflu commented on May 22, 2024

@nitriques Thanks for the suggestion and for the fix :) I'll let you know what happens.

from mailchimp.

nitriques avatar nitriques commented on May 22, 2024

@finferflu my pleasure 😄

from mailchimp.

finferflu avatar finferflu commented on May 22, 2024

I just tried by modifying line 837 in symphony/lib/toolkit/class.general.php as you suggested, however I still get that fwrite error, now I even get it when I try to uninstall the extension. Additionally, I'm seeing a few of these errors in the PHP log (I'm using version 5.3.29 now as you suggested):

PHP Catchable fatal error:  Argument 1 passed to Configuration::setArray() must be an array, null given, called in /path/to/symphony/install/www/symphony/lib/core/class.symphony.php on line 171 and defined in /path/to/symphony/install//www/symphony/lib/core/class.configuration.php on line 81

Additionally, I have tried to remove the mailchimp folder from the extensions folder, and now Symphony is just blank, showing the above error whenever I try to load the page. I have reverted the changes in class.general.php and I have put the mailchimp folder back into the extensions folder, but Symphony is still just blank.

from mailchimp.

nitriques avatar nitriques commented on May 22, 2024

To make the Symphony install work again, go in the DB, the table sym_extensions and delete the row holding the mailchimp extension.

As for your fwrite error, I am speechless since I can't reproduce it...

from mailchimp.

nitriques avatar nitriques commented on May 22, 2024

Also, can you confirm that the file is writeable ?

from mailchimp.

finferflu avatar finferflu commented on May 22, 2024

Actually, the problem was that the Symphony configuration file was completely blank, something must have emptied it as I tried to uninstall the mailchimp extension. Fortunately I had a backup, and after I restored it Symphony is working again.

Back to the original issue, the strange thing is that I can see that the extension is enabled in the database, however nothing is really showing up in the Preferences page…

from mailchimp.

finferflu avatar finferflu commented on May 22, 2024

Which file should be writable (I assume by the web server)?

Thanks! :)

from mailchimp.

nitriques avatar nitriques commented on May 22, 2024

manifest/config.php and yes by the user running the php process (which can be different from the user running apache)

from mailchimp.

finferflu avatar finferflu commented on May 22, 2024

Yes, it is. PHP is running as an Apache module, and the Apache process is owned by my user.

from mailchimp.

nitriques avatar nitriques commented on May 22, 2024

And you're back with the fwrite error ?

Can you try to delete the row in the extension table and install from scratch ?

from mailchimp.

finferflu avatar finferflu commented on May 22, 2024

Yes, I'm back to that error. I have tried removing that row from the database and I have installed from scratch both with the original line in class.general.php and the modified line you suggested. Nothing seems to help so far :(

from mailchimp.

nitriques avatar nitriques commented on May 22, 2024

:(

Let me recapitulate:

  1. The extension is not enable nor installed
  2. You try to install it.
  3. You get the error message about fwrite
  4. Extensions is somehow installed (?)
  5. Config values are NOT saved in config.php ?

If that 100% correct, can you please try to change the same line to

if (($handle = fopen($file, $mode)) === false) {

Also, could you try to var_dump the parameter ? (just before the fopen if)

var_dump($file, $data, $perm, $mode);die;

from mailchimp.

finferflu avatar finferflu commented on May 22, 2024

That is 100% correct although I'm not sure about what the extension should do in the background as it is being installed (from what you say I suppose it should write something to config.php), all I know is that I can't find any Mailchimp options in the Symphony Preferences page.

Anyway, I've edited line 837 in class.general.php just as you instructed, and I got the same fwrite issue. I then tried to var_dump those variables just above line 837 as you told me, but no variables are displayed on the screen when I try to enable/disable the extension, just the usual fwrite error again.

from mailchimp.

finferflu avatar finferflu commented on May 22, 2024

OK, what you said about the extension writing to config.php just opened my eyes. I double checked the permissions, and while config.php itself was writable by the web server, its containing folder wasn't. I have updated the permissions and the extension is finally enabled! :)

On a side note, uninstalling the extension now doesn't empty the config.php file any longer.

Thanks a lot for your help, and sorry for taking so long for figuring out this simple permissions issue (I don't know too much about the internals of Symphony unfortunately).

from mailchimp.

finferflu avatar finferflu commented on May 22, 2024

I just wanted to mention that when I tried to open the Events page, Symphony threw and error and I found that the file mailchimp/lib/mailchimp-api/MailChimp.php isn't included in the extension. I went ahead and downloaded it from the official repo and everything seems to work now. So it might be a good idea to have that file included with the extension.

from mailchimp.

finferflu avatar finferflu commented on May 22, 2024

Also, the extension version shown in the Mailchimp event is outdated: "2.0 released on 16 November 2013".

(I hope I'm paying back all the time you've wasted for me by finding these :)

from mailchimp.

nitriques avatar nitriques commented on May 22, 2024

Thanks a lot for your help, and sorry for taking so long for figuring out this simple permissions issue

No problem! Glad you found out the problem. But it is still weird since there is a check about both the directory and the file (https://github.com/symphonycms/symphony-2/blob/2.3.1/symphony/lib/toolkit/class.general.php#L829).. I might log and issue in the core...

So it might be a good idea to have that file included with the extension.

It is, but as a git submodule, so you need to git submodule init && git submodule update when you check it out.

*EDIT: * just went to check the .zip download and it's missing. DAMN. Thanks for reporting!

from mailchimp.

nitriques avatar nitriques commented on May 22, 2024

Finally, there was a bug in the write function in Symphony 2.3 (that's where the fwrite error comes from) and it has been fixed. Pffffeeewww!!

from mailchimp.

finferflu avatar finferflu commented on May 22, 2024

Oh I see, thanks for the heads up! :)

from mailchimp.

Related Issues (13)

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.