[Elgg 1.5-1.12 & 2.X - 4.X: Tidypics] v1.9.2

Release Notes

No longer beta! Apart from the things mentioned in the ToDo section everything should work. If not, please tell me.

Changes:

1. Rework of river activity settings (check the settings and make adjustments if necessary):

  • new option to set preview image size for all kind of Tidypics' river entries,
  • click on preview image in river now opens full size version of the image in a lightbox popup.

2. Fix of group album handling. Group members (who are no admin) can upload images again to any group album (not only their own).

  • After the release of elgg 1.9.0 and tidypic 1.9.2, I try to upgrade my instance to this release.

    I have a problem with the tidypics 'upgrade' script (report in the 1.8.1beta16 thread).

    But I also have a strange situation :

    When commenting a photo in an album, it works.

    When commenting an album, it send the notification, but the comment doesn't appear under the album page.

    For any more detail ...

  • @xavier g. Can't reproduce the issue with the album comments. The comments do appear as expected for me. Does this problem occur after the (failed / incomplete) upgrade or do the comments fail to show up already on 1.8.1beta15 (as it seems the last release working for you)? If the problem started only with the new release, it might be due to the upgrade issue.

    How many photos and albums are on your site (you can see the numbers on the "Administer - Statistics - Overview" page in the admin section of your site)? Maybe the issue is due to the high number of entries - something I can't test very well. Depending on the number of entries the upgrade might take some time. Do you see the script still running or has it stopped running without completing the upgrade?

    Had you executed any upgrades offered by Tidypics before or where there any outstanding upgrades (i.e. the upgrade button showed on the Tidypics plugin settings page)?

    Maybe it helps to repeat the upgrade with all other 3rd party plugins disabled. I can't rule out that there might be issues during the upgrade due to other plugins interferring. In any case you should repeat the upgrade only after restoring the old state of your site from your backup as I can't say what happens with the upgrade already partly done.

  • After your comment, i made a few new test.
    Statistics: 300 photos in 30 albums.

    First: working 1.8.1beta15 instance, everything si ok.
    Then disable all plugins excepts mandatory ones.
    Upgrade elgg to 1.9 witch the procedure : delete all elgg directory ans replace with the new files.
    Install tidypics 1.9.1beta15, and do some test : everything ok.

    Disable tidypics / delete old directory / copy 1.9.2 directory / enable tidypics.
    -> do some test, ok.

    Launch tidypics upgrade, don't close browser during 2 hours. No error in apache logs.
    Interrupt the process and do the test again:
    Commenting photo OK
    commenting album Failed.

    Your feeling is good. The album comment problem appears after the Failed upgrade process.

    On my installation, this problem appears after 1.8.1beta16 or 1.9.1beta16 release.
    Do you Know how i can help to investigate that issue ?

  • 300 photos / 30 albums aren't that many. Even with a fair number of comments made to each photo and album the upgrade shouldn't take more than a minute (a few minutes at most).

    If the problem would only occur on Elgg 1.9 I would say there might be a problem with Elgg itself. In either case, you need to finish the core upgrades (including executing of any suggested upgrades) on Elgg 1.9 before you can begin with running the Tidypics upgrade script. But if you also have a problem upgrading to the latest version of Tidypics on Elgg 1.8 there is likely some other reason, too.

    What I would suggest to do is adding some elgg_dump() outputs within the Tidypics upgrade script to find out at which point the upgrade got stuck. The upgrade script that is new in Elgg 1.X.1beta16 or 1.X.2 respectively is the file with the highest number (date) in mod/tidypics/upgrades. Within the upgrade script I've added comments to show the different parts of the upgrade process. You could now add something like

    elgg_dump('Tidypics upgrade: part xxx finished.', false, 'NOTICE');

    between the upgrade process sections. This line will output the string in the first parameter ('Tidypics upgrade: part xxx finished.') in the error log (either php or Apache error log - depends on your server config). Better add more than less outputs to better know at which point the upgrade fails.

  • Good trick elgg_dump (Yes, it's my first contact with debugging Elgg).

    To reduce the bug scope, I focus the upgrade process in Elgg1.8. Here what I do :

    Start : Working Elgg1.8 instance, with tidypics 1.8.1beta15 install.

    Deactivate tidypics - remove all /mod/tidypics directory - copy tidypics1.8.1beta16 files.

    The upgrade process was launched, and with the debug, I see taht the part3 run into an infinite loop.

    I'm too newbie with Elgg and advanced php coding to go ahead, do you have any trick ?

  • @xavier g. Next, you could check if the problem is within the foreach loop or already before that:

    $batch = new ElggBatch('elgg_get_annotations', array(
        'annotation_name' => 'generic_comment',
        'joins' => array("JOIN {$db_prefix}entities te ON te.guid = n_table.entity_guid"),
        'wheres' => array("te.subtype = $tidypics_album_subtype_id"),
        'limit' => false
    ));

    <   elgg_dump here   >
    $batch->setIncrementOffset(false);

    <   elgg_dump here   >
    foreach ($batch as $album_comment) {
        $river_entry_count = elgg_get_river(array(
            'type' => 'object',
            'subtype' => 'album',
            'action_type' => 'comment',
            'annotation_id' => $album_comment->id,
            'count' => true
        ));
        
        if($river_entry_count < 1) {

    <   possible elgg_dump here   >
            elgg_delete_annotation_by_id($album_comment->id);
        }
    }

    Within the loop itself it might not make much sense to add an elgg_dump as you might end with a lot of entries in the logs (but you still can try it as you might not have that many duplicate comments that need to be removed). In principle, this part of the upgrade tries to delete comments that might appear twice after the upgrade otherwise (this is only the case if someone commented directly on an image upload on the activity river page). Basically, it's just a little flaw to let these comments stay, so could also comment out this part of the upgrade.

    The question is, if part 4 of the upgrade works on your site or if the same problem occurs. In part 4 the likes made on the river activity page on image uploads are cleaned up (assigned either to the corresponding image or album respectively). Again, it wouldn't be a serious problem, if this part of the upgrade script would be commented out. It would only result in possibly some likes not showing up anymore.

    Another thing you could try is using the Database Validator plugin (https://community.elgg.org/plugins/438616/1.4/database-validator) before doing the Tidypics upgrade. There's a chance that some faulty entries exist in the database resulting in the Tidypics upgrade to get stuck. You could do a validation of the database with the validator plugin at least to see if there are any problems found. If there are no problems found, you wouldn't have to make a repair run (and the Tidypics upgrade doesn't get stuck due to such faulty entries at least).

    What I still don't understand is why the commenting on albums fails to work correctly after the upgrade. I'll have to think about that some more because the visibility of comments made on albums (especially any new comments) shouldn't be affected by the upgrade at all.

  • Hi,

    I make some debug, and in the loop I see that the album_comment->id is always reapeating.

    After commenting this line ($batch->setIncrementOffset(false); ) the upgrade finish without error, including part4.

    I'll now try with Elgg1.9 and tidypics 1.9.2.

     

  • I confirm : the tips works with Elgg 1.9 too.

    After commenting this line, I could upgrade Elgg to 1.9, tidypics to 1.9.2 without any error, and then comment to the album works fine.

    If I continue in this way with my production site, is there a risk that in the future the problem occurs again if a new upgrade procedure is needed ?

  • Was it necessary to comment out the $batch->setIncrementOffset(false); line also within part 4 of the upgrade script or has part 4 finished without any need of modification?

    The line you removed is necessary to keep the loop in sync with the batch offset in case an entry of the batch gets deleted within the loop (which this loop is about). As mentioned before, this part of the upgrade isn't critical. It's just about removing possible duplicate comments. Maybe this part fails in your case even because there aren't any duplicate comments in the first place - need to do some tests to be able to say for sure. You might have some duplicate comments remaining now as they might have been skipped in the loop. But there shouldn't be any issues in future upgrades (but I hope there's no need for upgrading the comments entities anymore anyway).

  • no change in part4.

    In my little site, no duplicate comment found ...

    I can now upgrade my production site to tidypics 1.8.2 (and then elgg 1.9)

    Thank you for your support.

  • i installed it under Elgg 1.9.1 and i can create a album but can not upload.

    I can click the upload button but nothings happed.

    Can you advice me?

     

    regards..

  • @whitetornado Have you tested if the problem occurs both with the html5 uploader and the basic uploader? Do you see any entries in the error logs of your server that might be connected with the problem? Is it a fresh Elgg 1.9 installation or have you upgraded from Elgg 1.8 (and an older version of Tidypics worked before)?

  • its a fresh install..

    i disabled the HTML5/HTML4 uploader and still not work under Chrome, but now it works under 

    IE 9, but got now this error:


    open_basedir restriction in effect. File(/) is not within the allowed path(s):

    so Chrome is not working and html5/4 uploader also not under IE.
    I have installed Imagemagick, and as command folder /usr/bin

    When i check this under settings and give this folder also and run it, there is no response.

    Enter the path to your ImageMagick commands i dont get any response

    Imagemagick is installed.

  • @whitetornado open_basedir restricts the files accessible by php to the the directories explicitly allowed (see http://php.net/manual/en/ini.core.php#ini.open-basedir). It's a php.ini setting and not connected directly to Tidypics - though Tidypics - and possibly Elgg itself too - can fail to work correctly as it does in your case, if open_basedir is used.

    I'm not sure here if the cause is that your data directory isn't included in the list of allowed directories in the open_basedir definition or if it might be the use of ImageMagick (and consequently "/usr/bin/") that is not included.

    I would suggest to change the config of open_basedir on your server (or you might have to talk with the hoster's support if you can't do this on your own if it's even allowed by them and if they do it for you).

    When setting up the filepath to the ImageMagick executables (or testing them) you should provide the path with a trailing slash, i.e. "/usr/bin/" and not just "/usr/bin".

  • I'm also having upload problems. I tried both with and without the html5 uploader. I get only a white box and a spinning grey center piece with a close link on the bottom right. I've tried in both chrome and safari in osx 10.9.5.

    I can upload from IOS 7 though....

     

  • The basic uploader is really quite stable and if if fails not only with the html5 uploader but also with the basic uploader, there might be some errors in the Tidypics plugin configuration, the php variables in .htaccess are set to too small values or (especially on Elgg 1.9) there might be a conflict with another plugin.

    • Which image library have you configured on the Tidypics settings page? ImageMagick executables are the best (by my experience) but the ImageMagick tools have to be installed on the server and you have to enter the path to the commands. Second best alternative is imagick php extension (if available). Fallback is the GD image library but this image library has high memory requirements.
    • In .htaccess set memory_limit large enough (64M is rather the minimum, if GD library is used 128M is the suggested minimum). Next, upload_max_filesize has to be large enough (at least as large as the max image size configured in Tidypics settings). Lastly, post_max_size MUST be large enough!! The value for post_max_size has to at least as large as the sum of the uploaded images plus some overhead (maximum of 10 images can be uploaded, default max image size is 5 ---> post_max_size should be at least 50M - or make it 64M to be on the safe side).
    • If the upload still does not work, disable all other 3rd party plugins temporarily. This is the easiest way to figure out if there is any conflict due to another plugin. If it still does not work with all other 3rd party plugins disabled, you know at least that there is no conflict. If it works with all other plugins disabled, you can enable them again one by one and test the upload each time until you found the problematic plugin. Without me knowing which plugin it might be that causes the issue I can't give any help for sure.
  • Changed all of the htaccess settings - ( which were all too low, but always worked before 1.9) and still no joy. 

    did the plugins one by one and this one seems to break it.... can't figure why it would but.....

     

     

    Analytics 2.1 

    Adds analytics tracking code (by Google or Piwik) to all Elgg pages

    Author: ColdTrick IT Solutions - http://www.coldtrick.com/

       

       

    • @knussear I can't say much about the Analytics plugin. I've never used it so far and I won't register at Google now just to test it out (don't know if it would work when used on a local test server anyway). Sorry.

      On looking at the code of the Analytics plugin I've noticed that there are two plugin options to include Actions and Events in the analysis. These options might be the problem - more likely the Actions options. I don't know what they do exactly and why they are even necessary. You could try to disable these options (at least for testing) to see if the conflict with Tidypics stops then.

      I wonder if the same problem also occurs already on Elgg 1.8 when using Tidypics and the Analytics plugin together. If that isn't the case, I wonder if the Analytics plugin might need some modifications for Elgg 1.9 in general. I haven't seen anything in code that looks as if it would have to get updated but I wasn't able to understand it in all details anyway on just a brief look without testing it.

      It might help asking Jeroen from Coldtrick himself in this matter (best would be on the plugin page of the Analytics plugin). Maybe he can tell more about what the problem is.

    • @knussear I've been able to test the Analytics plugin together with Tidypics on a local installation of Elgg 1 .9. As I mentioned in my last posting already I'm not sure if the Analytics plugin is really fully operational when using it on a local installation but I hadn't any issues with Tidypics when the Analytics plugin was enabled.

      Are you really sure that the Analytics plugin is causing the problem with the uploader? Or could the problem be caused by another plugin?

    • I had the same combination working in Elgg 1.8 without any problems. I disabled only the Analytics plugin and now things are working just great. I also noticed that a problem I had with the map opening in the Event Manager Plugin has been fixed by this action as well.  In the end I don't use the Analytics all that much, so for me it works to leave it off. Thanks for the tip on Actions - I will investigate that.

       

    • @iionly - Following up the Analytics plugin - you called it right.  It does indeed appear to be related to the track elgg actions and track elgg events. If either of those two are enabled the tidy pics uploader window locks up - the one where you either select new album or current album. It also locks up a pop up map window in the Event manager plugin.

    • @knussear I've reported the problem to the Analytics plugin developer. I can only hope it will get fixed.

    Stats

    • Category: Photos and Images
    • License: GNU General Public License (GPL) version 2
    • Updated: 2022-5-15
    • Downloads: 142114
    • Recommendations: 232

    Other Projects

    View iionly's plugins