elgg 1.12 strange behavior

I have a question about a strange behavior, I am implementing masonry and infinite-scroll as a plugin, I tested from elgg 1.8 to 1.12 and work well with the exception of 1.12 where infinite-scroll loads good but can´t find the following pages. I made a lot of tests, checked changes in pagination and navigation, I changed parts of the code of the plugin and compared the differences between version 1.11 and 1.12 but I have not found any solution.

However I discovered that it works correctly after the upgrade from 1.11 to 1.12 (I just replace all files except .htaccess and engine/settings.php)

Comparing clean installations of version 1.11 and 1.12 I saw that there are not difference between the entries in the database, .htaccess and settings.php files, there are not conflicts with plugins. The infinite-scroll does not work when I do a downgrade from 1.12 to 1.11 neither

I have not idea which is the reason that why fails in version 1.12, because it works fine with an upgrade from 1.11, someone knows why happens this? and any solution? For now my only solution is install 1.11 and then upgrade to 1.12.

I will really appreciate any clue or way to found the reason for this behavior, I have been working for weeks doing tests and do not have any idea what fails. All my tests are in localhost, in pc and mac with safari, explorer and firefox. Works fine in versions 1.8, 1.9, 1.10, 1.11.

Thanks again

 

  • Start printing debug messages from each significant point of the plugin and/or Elgg core. That way you'll trace down the exact point where it fails.

    Start from the javascript. Does it do a successful request to the server? If so, what does it return? If it returns an error or doesn't return anything, check the end point that it is calling on the server side, etc.

    Use console.log() in javascript and check the output from the browser console.

    On the server side use error_log() and check the output from the server's error log.

  • thanks Juho, I will try it all and I hope to find some solution, when I know something else, I will comment here the information

  • What exactly is the plugin in question? Is it from the community or have you made it yourself? Is the source code available somewhere?

  • Is a plugin made by me, I'm adapting jquery masonry (v 2.1.03) made by David DeSandro with infinite-scroll (v 2.0b2.110713) by Paul Irish & Luke Shumard are earlier than currently published at http: // masonry.desandro.com/  because they were available versions when I started to develop

    sorry if my explanation is confusing, I do not speak English :)

  • Consider making your plugin available e.g. through https://github.com/. That way you might get other people to help you develop it.

  • Hello again

    Thanks to Juho for his tips. I was reviewing the console-log() and I found a depecated event that no longer worked in version elgg 2.0 because it uses jquery 2.2.0 and other small bugs. Through apache access.log finally I found the failure that happens in the infinite-scroll when the next page loads, I do not know why the failure happens but I know what is the solution.

    All my test installations have the name of elgg version (eg elgg-8, -11, -12 ...) for some reason when the route contains 2 the Get of apache changes to 1 to call the next page loaded into the infinite-scroll, for that reason failed elgg-version 1.12 and/or 2.0.

    ::1 - - [10/Feb/2016:17:57:25 +0100] "GET /tester/doce/elgg1134567890/core?offset=20 HTTP/1.1" 404 1343 "http://localhost/tester/doce/elgg1234567890/core" "Mozilla/5.0 (Windows NT 10.0; Trident/7.0; rv:11.0) like Gecko"

    The xampp htdocs folder /tester/doce/elgg1234567890/core
    /elgg1234567890 is the name of the folder that contains the installation of elgg and has that name to test if another number changes as well.
    /core is the name of the page where masonry is applied.

    Only changes the 2 for 1 anywhere on the route when it's trying to load the next page, only happens with infinite-scroll. I found in jquery.infinitescroll.js file a regex that identifies the 2 and change the route

    path = path.match(/^(.*?)2(.*?$)/).slice(1);

    I don´t know well the language JavaScript but will try to modify or try a different version of infinite-scroll to resolve this issue, it is part of learning; D

    In relation to make available the plugin, It took me a long time working on it, even I do not have a functional version because it is related with other plugins and theme, I have not done an administer interface to apply on specific pages yet, it is also necessary to modify or adapt the river views or objects to a brick, but I did it from other plugin. Work on it to share it with the elgg community as soon as possible even if not fully operational for other themes or plugins out of the included on the installation.

    thank you so much.

  • That regex seems weird. Which infinite scroll library and version are you using?

  • Sorry for my late reply.

    I test with infinite-scroll by Paul Irish version 2.0.2, it´s an unmaintained release but works fine except for the regex of '2' ;D

    https://github.com/infinite-scroll/infinite-scroll/releases

    the newest versions of David DeSandro's masonry not include this infinite scroll since v.3, i don't work with the new 4 version because I like the behavior of v.2, perhaps later I test the new masonry to see what advantages does

    thank you Juho for your interest

     

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking