Announcement

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

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

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13790

[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

Offline

 

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

romanf
Member
2017-01-22
40

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
Nantes, France, Europe
2002-04-05
13790

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.

Offline

 

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

romanf
Member
2017-01-22
40

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
Nantes, France, Europe
2002-04-05
13790

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?

Offline

 

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

romanf
Member
2017-01-22
40

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
Nantes, France, Europe
2002-04-05
13790

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 :-)

Offline

 

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

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13790

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.

Offline

 

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

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13790

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.

Offline

 

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

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13790

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).

Offline

 

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

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13790

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.

Offline

 

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

romanf
Member
2017-01-22
40

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

 

#13 2017-09-25 11:53:01

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13790

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

Hi,

I just encountered still the same problem with version 2.8.1 : Stripped + MenuRandomPhoto 2.8.1 + option "show menu" on photo page.

Offline

 

#14 2017-09-26 21:21:25

romanf
Member
2017-01-22
40

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

Heya,

plg wrote:

I just encountered still the same problem with version 2.8.1 : Stripped + MenuRandomPhoto 2.8.1 + option "show menu" on photo page.

The variable MRP_blockHeight gets defined in menu_random_photo.js.tpl which in term should get loaded from main.inc.php.

I don't see why it is loaded sometimes and sometimes not... :-(
Hard to debug as I can still not reproduce it.

-Roman

Offline

 

#15 2017-09-29 14:23:37

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13790

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

Hi romanf,

I can easily reproduce : theme Stripped + option "show menu" on photo page [Administration > Configuration > Options > Display] + MenuRandomPhoto

I have pushed a new commit http://piwigo.org/dev/changeset/31891 to fix it

Offline

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

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact