Piwigo.org

You are not logged in. (Register / Login)

Announcement

#1 2017-05-22 09:49:31

plg
Piwigo Team
Location: Nantes, France, Europe
Registered: 2002-04-05
Posts: 13060
Website

[Menu Random Photo, 2.7.d] ReferenceError: MRP_blockHeight...

Hello romanf,

With theme Stripped, on the page of the photo (ie picture.php) I get this javascript error in the console:

Code:

ReferenceError: MRP_blockHeight is not defined

... and the picture is not shown at all (because it relies on javascript)

Piwigo version: 2.9.0
Theme : Stripped 2.5.7
PHP version: 5.6.14
MySQL version: 5.5.46


Latest blog post (March 23th 2017) Piwigo.com Enterprise plans, now official!

Offline

 

#2 2017-05-23 18:36:33

romanf
Member
Registered: 2017-01-22
Posts: 25

Re: [Menu Random Photo, 2.7.d] ReferenceError: MRP_blockHeight...

Hi plg,

I can't reproduce it. Does it work on other themes?
The JS in MenuRandomPhoto consists of two parts: menu_random_photo.js.tpl which get's expanded by the template engine (and contains the definition of MRP_blockHeight, amongst others) and mrp.js which handles the rotation of the pics via timer...

Can you look at the source of the page and check for
...
var MRP_blockHeight=
...
and
...
function doRotate()
...

Thanks
Roman

Offline

 

#3 2017-06-02 16:31:05

plg
Piwigo Team
Location: Nantes, France, Europe
Registered: 2002-04-05
Posts: 13060
Website

Re: [Menu Random Photo, 2.7.d] ReferenceError: MRP_blockHeight...

Hi romanf,

The problem does not seem to be for Stripped theme. I reproduce it with Elegant theme as well.

Go on page [Administration > Configuration > Options > Display] and check the option "show menubar" in the "Photo page" section. You will get the error in your browser console.


Latest blog post (March 23th 2017) Piwigo.com Enterprise plans, now official!

Offline

 

#4 2017-06-12 21:35:23

romanf
Member
Registered: 2017-01-22
Posts: 25

Re: [Menu Random Photo, 2.7.d] ReferenceError: MRP_blockHeight...

Heya,

I uploaded a new version of the plugin. Apart from the new feature, it should also fix the problem you reported.

Feedback very much welcome! :)

Rgds
Roman

Offline

 

#5 2017-07-17 15:52:29

plg
Piwigo Team
Location: Nantes, France, Europe
Registered: 2002-04-05
Posts: 13060
Website

Re: [Menu Random Photo, 2.7.d] ReferenceError: MRP_blockHeight...

Hi romanf,

Just made the test with version 2.8.0 of Menu Random Photo and still the same issue. Don't you reproduce it?


Latest blog post (March 23th 2017) Piwigo.com Enterprise plans, now official!

Offline

 

#6 2017-07-17 20:11:45

romanf
Member
Registered: 2017-01-22
Posts: 25

Re: [Menu Random Photo, 2.7.d] ReferenceError: MRP_blockHeight...

I did a clean install and could not reproduce it. :(

-Roman

Offline

 

#7 2017-07-24 13:04:18

plg
Piwigo Team
Location: Nantes, France, Europe
Registered: 2002-04-05
Posts: 13060
Website

Re: [Menu Random Photo, 2.7.d] ReferenceError: MRP_blockHeight...

Hi romanf,

I've pushed 2 commits on SVN :

1) fix bug on the picture page displaying the menubar
2) automatically disable MenuRandomPhoto on SmartPocket

Please review and push a new version of the plugin :-)


Latest blog post (March 23th 2017) Piwigo.com Enterprise plans, now official!

Offline

 

#8 2017-07-24 17:56:49

plg
Piwigo Team
Location: Nantes, France, Europe
Registered: 2002-04-05
Posts: 13060
Website

Re: [Menu Random Photo, 2.7.d] ReferenceError: MRP_blockHeight...

Actually, I also see a problem on Stripped + option menubar on picture page. Fixing it.


Latest blog post (March 23th 2017) Piwigo.com Enterprise plans, now official!

Offline

 

#9 2017-07-24 18:17:55

plg
Piwigo Team
Location: Nantes, France, Europe
Registered: 2002-04-05
Posts: 13060
Website

Re: [Menu Random Photo, 2.7.d] ReferenceError: MRP_blockHeight...

And there's a major issue with upgrade system. All users who have updated from 2.7.x to 2.8.0 version have not applied the new database changes. I'm pretty sure it's because file maintain.inc.php should be renamed maintain.class.php.


Latest blog post (March 23th 2017) Piwigo.com Enterprise plans, now official!

Offline

 

#10 2017-07-24 18:25:03

plg
Piwigo Team
Location: Nantes, France, Europe
Registered: 2002-04-05
Posts: 13060
Website

Re: [Menu Random Photo, 2.7.d] ReferenceError: MRP_blockHeight...

When adding a new configuration setting to a plugin, you should follow this pattern [Github] Piwigo-Skeleton file maintain.class.php@L52 :

Code:

      $old_conf = safe_unserialize($conf['skeleton']);
      if (empty($old_conf['option3']))
      { // use case: this parameter was added in a new version
        $old_conf['option3'] = 'two';
      }
      conf_update_param('skeleton', $old_conf, true);

Or else the user will always have to restore the plugin (and lose all current settings).


Latest blog post (March 23th 2017) Piwigo.com Enterprise plans, now official!

Offline

 

#11 2017-07-25 11:31:21

plg
Piwigo Team
Location: Nantes, France, Europe
Registered: 2002-04-05
Posts: 13060
Website

Re: [Menu Random Photo, 2.7.d] ReferenceError: MRP_blockHeight...

OK, I pushed 2 new commits to implement the auto-update mechanism. Now in your function getRandomPictures, you should not need this test any longer:

Code:

if (!isset($conf['MRP']['apply_to_albums']))

Please make some tests and I think you can publish a version 2.8.1 :-) (I'm going to push this on Piwigo.com, considering many users have the message:

MenuRandomPhoto seems not to be installed/configured properly. Please remove and reinstall.


Latest blog post (March 23th 2017) Piwigo.com Enterprise plans, now official!

Offline

 

#12 2017-07-25 20:52:24

romanf
Member
Registered: 2017-01-22
Posts: 25

Re: [Menu Random Photo, 2.7.d] ReferenceError: MRP_blockHeight...

Thanks for all your work! It's very much apreciated.
I published the SVN/HEAD as 2.8.1.

Cheers
Roman

Offline

 

Board footer

Powered by FluxBB

github twitter facebook google+ newsletter Donate Piwigo.org © 2002-2017 · Contact