craft-instagram-feed icon indicating copy to clipboard operation
craft-instagram-feed copied to clipboard

PHP errors when using devMode

Open MangoMarcus opened this issue 6 months ago • 0 comments

Describe the bug:

There's 2 PHP issues which are fatal when using Craft's dev mode

  1. Unknown Property – yii\base\UnknownPropertyException - Getting unknown property: codemonauts\instagramfeed\models\Settings::userAgent - this property doesn't exist on the settings model
  2. Error - Undefined constant codemonauts\instagramfeed\services\InstagramService::CACHE_TAG - this constant doesn't exist and so isn't used when the cache is set, which means that the "Instagram data" option under "Invalidate Data Caches" currently has no effect.

Steps to reproduce:

  1. Enable devMode in craft/config/general.php
  2. Opening the app in your browser should trigger the first error, and trigger the second you need to go to Settings > Utilities > Caches in the CMS

Where is it happening?

  • [ ] On a server
  • [x] Local dev environment

What are you requesting: Username: ... Hashtag: ...

Config file:

return [
    // User name or hash tag to fetch from Instagram.
    'instagramUser' => 'xyz',

    // Use codemonauts proxy to get the Instagram page
    'useProxy' => true,

    // The proxy key to use for authentication
    'proxyKey' => 'XXX',

    // Timeout in seconds waiting for the Instagram page to load.
    'timeout' => 10,

    // Dump Instagram response to file for debugging purpose. In an event of unknown structure, it will happen automatically.
    // You will find the dumps in Craft's storage path in the folder runtime/instagramfeed with the timestamp as file name.
    'dump' => true,

    // Use volume to store Instagram images locally, otherwise the storage path will be used
    'useVolume' => true,

    // The handle of the volume to use for storing Instagram images locally
    'volume' => 'XXX',

    // Subpath to use in volume
    'subpath' => 'XXX',
];

Software versions: Plugin Version: 2.2.1 PHP Version: 8.2.20 CraftCMS Version: Craft Pro 4.8.8

MangoMarcus avatar Aug 14 '24 13:08 MangoMarcus