How to manually add Mobile_Detect

Hi, we followed instructions you gave here https://www.ubertheme.com/question/mobile_detect-class-missing/ to manually install Mobile_detect.php
We have downloaded it, placed it in vendor/mobiledetect/mobiledetectlib/… but nothing has changed, we’re still getting a “Fatal error: Uncaught Error: Class ‘Mobile_Detect’ not found in /var/www/--domain--/public_html/app/code/Ubertheme/UbContentSlider/Block/Slider.php
Any help appreciated…

12 answers

Profile photo of Mall Staff 156270.00 $tone November 5, 2020
Public

Hi there,

We have downloaded it, placed it in vendor/mobiledetect/mobiledetectlib/… but nothing has changed, we’re still getting a “Fatal error: Uncaught Error: Class ‘Mobile_Detect’ not found in /var/www/--domain--/public_html/app/code/Ubertheme/UbContentSlider/Block/Slider.php
Any help appreciated…

Did you run the ‘setup:upgrade’ command after you made the change?
php -f bin/magento setup:upgrade;

If you still need further helps, please provide me information about your instance:

  • URL and Admin credentials of your M2 instance
  • SSH credentials of your M2 instance
  • Let know the path to the M2 folder

I will help to check further and get back to you then.
PS. Please make sure you mark your reply private or simply switch this ticket to the private mode. Then it’s safe to share your site info here. Only you and our technical team can access it. 

Regards,
Mall.

#1
Profile photo of Mall Staff 156270.00 $tone November 6, 2020
Public

Hi there,

We have downloaded it, placed it in vendor/mobiledetect/mobiledetectlib/

I helped to add more declaration in the PHP file at vendor/composer/autoload_static.php
For your information, the new declaration line: http://prntscr.com/vejmqa

Please note that the declaration will be automatically added by Composer if you installed the library via the composer.
 
And then, the issue you mentioned has been solved. 

Regards,
Mall.
 

#4
Profile photo of Mall Staff 156270.00 $tone November 6, 2020
Public

Hi there,

 we’re now getting an error on our homepage:
Errore sul filtro template: Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/nottetempo.mon-key.net/public_html/app/code/Ubertheme/UbContentSlider/view/frontend/templates/media.phtml on line 27

I didn’t see that issue when accessing your home page at my end: http://prntscr.com/vekp5v
You can learn more about how to use our module in the guide at: https://www.ubertheme.com/docs/magento-2-ub-content-slider/
Regards,
Mall.

#6
Profile photo of mon-key 90.00 $tone November 6, 2020
Public

Hi, if you scoll down the error is displayed, above the block with a photo an green background on the left, and the Top 5 on the right -- directly above that block

#7
Profile photo of Mall Staff 156270.00 $tone November 6, 2020
Public

Hi there,
I have checked further on your site and I saw the root issue as the following:
You have created a Slider with slider_key = “homepage_slider”: http://nottetempo.mon-key.net/
But in the shortcode to load the Slider, you set the wrong value of the param ‘slider_key’:

{{block class=”Ubertheme\UbContentSlider\Block\Slider” name=”ub.content.slider.video” title=”Video Slider” content_type=”slider” slider_key=”home_slide” number_items=”1″ }}

It should be:

{{block class=”Ubertheme\UbContentSlider\Block\Slider” name=”ub.content.slider.video” title=”Video Slider” content_type=”slider” slider_key=”homepage_slider” single_item=”1″ }}

I have edited that for you: http://prntscr.com/vepr81
Please have a look again and clean all caches on your site to see the new changes.
Also, you can learn more about how to use our module in the guide here
Regards,
Mall.

#8
Profile photo of ubdev Staff 73680.00 $tone November 6, 2020
Public

Hi there,
We’re glad that it helped. 
Please continue with the configuration at your end. If you have any questions, feel free to get back to us here.
Regards,
Ubertheme team
 

#12

Please login or Register to Submit Answer

Written By

Comments