seregazhuk / php-pinterest-bot

This PHP library will help you to work with your Pinterest account without using any API account credentials.
MIT License
413 stars 129 forks source link

Get a list of sections for a specified boardId not working #383

Closed delemore closed 6 years ago

delemore commented 6 years ago

Hi

Running: $sections = $bot->boardSections->forBoard($boardId);

returns this error: _Fatal error: Uncaught seregazhuk\PinterestBot\Exceptions\WrongProvider: Provider seregazhuk\PinterestBot\Api\Providers\Boardsections not found. in /mypath/vendor/seregazhuk/pinterest-bot/src/Api/ProvidersContainer.php:191 Stack trace: #0 /mypath/vendor/seregazhuk/pinterest-bot/src/Api/ProvidersContainer.php(119): seregazhuk\PinterestBot\Api\ProvidersContainer->resolveProviderClass('boardsections') #1 /mypath/vendor/seregazhuk/pinterest-bot/src/Api/ProvidersContainer.php(104): seregazhuk\PinterestBot\Api\ProvidersContainer->addProvider('boardsections') #2 /mypath/vendor/seregazhuk/pinterest-bot/src/Api/ProvidersContainer.php(82): seregazhuk\PinterestBot\Api\ProvidersContainer->getProvider('boardsections') #3 /mypath/test_section.php(30): seregazhuk\PinterestBot\Api\ProvidersContainer->_get('boardSections') #4 {main} thrown in /mypath/vendor/seregazhuk/pinterest-bot/src/Api/ProvidersContainer.php on line 191

Could you please have a look at this?

seregazhuk commented 6 years ago

Hi! I've just checked and it works. Are you using the latest library version?

delemore commented 6 years ago

I just updated to the latest Version, but still get this error message.

Here my complete script:

`<? require('vendor/autoload.php');

use seregazhuk\PinterestBot\Factories\PinterestBot;

$bot = PinterestBot::create();

// Login $bot->auth->login('', '');

$error = $bot->getLastError(); echo $error; if($error!='') { echo"$error


"; die();}

echo"Sections


";

$boardid='215258125878669038';

$sections = $bot->boardSections->forBoard($boardid);

echo"

";
print_r($sections);
echo"
"; ?>`

seregazhuk commented 6 years ago

Just to be sure that you have an updated version. Do you have file /mypath/vendor/seregazhuk/pinterest-bot/src/Api/Providers/BoardSections.php?

delemore commented 6 years ago

Yes, i do habe this file in my directory.

seregazhuk commented 6 years ago

I think that you have missed something. Check your code. I have created an empty project with the latest version and it works. pinterest-board-sections

delemore commented 6 years ago

I even copied manually the complete "src" Folder here from github. I still get error.

seregazhuk commented 6 years ago

Have you repeated the steps I've done in the gif above?

delemore commented 6 years ago

Yes, I repeated the steps shown in your gif.

Just now I did Change the filename "BoardSections.php" to "Boardsections.php" (no capital S) and I only get this error: bool(false)

seregazhuk commented 6 years ago

Oh, I see. It was the filename issue 🤦‍♂️ sorry about that. I'll fix it tomorrow. I think false is because in my example I didn't log in and used some random board id.

delemore commented 6 years ago

It Looks like? Inbetween I could solve the bool(false) error, I uncommented the Login-part of the script ;-) Right now I am testing some boards.

Btw: Thank you so much for your support!!

delemore commented 6 years ago

I confirm, the issue was the filename.

seregazhuk commented 6 years ago

Thank you for help with finding the bug :wink: !

delemore commented 6 years ago

You're welcome. Glad to help you 👋

seregazhuk commented 6 years ago

@delemore I've fixed the issue with filename BoardSection. Please update to version 5.7.2 and it will work as expected :wink: 👍