Skip to content
This repository has been archived by the owner on Dec 30, 2020. It is now read-only.

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

Closed
delemore opened this issue Jun 7, 2018 · 14 comments
Closed

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

delemore opened this issue Jun 7, 2018 · 14 comments

Comments

@delemore
Copy link

delemore commented Jun 7, 2018

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
Copy link
Owner

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

@delemore
Copy link
Author

delemore commented Jun 7, 2018

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
Copy link
Owner

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
Copy link
Author

delemore commented Jun 8, 2018

Yes, i do habe this file in my directory.

@seregazhuk
Copy link
Owner

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
Copy link
Author

delemore commented Jun 8, 2018

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

@seregazhuk
Copy link
Owner

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

@delemore
Copy link
Author

delemore commented Jun 8, 2018

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
Copy link
Owner

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
Copy link
Author

delemore commented Jun 8, 2018

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
Copy link
Author

delemore commented Jun 8, 2018

I confirm, the issue was the filename.

@delemore delemore closed this as completed Jun 8, 2018
@seregazhuk
Copy link
Owner

Thank you for help with finding the bug 😉 !

@delemore
Copy link
Author

delemore commented Jun 9, 2018

You're welcome. Glad to help you 👋

@seregazhuk
Copy link
Owner

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants