Problem/Motivation

The module tries to render the block, performing an API request to tweets/search/recent, when the API authorization request fails. Instead it should recognize if the auth request fails and then not attempt the search request.

Steps to reproduce

Configure the module with faulty API credentials.
Display a Twitter block.

Proposed resolution

Verify in TwitterBlockBase::build() whether the authentication request succeeded before trying to display the tweets.

Remaining tasks

Work out how.

User interface changes

n/a

API changes

n/a

Data model changes

n/a

CommentFileSizeAuthor
#2 twitter_api_block-n3346699-2.patch680 bytesdamienmckenna

Comments

DamienMcKenna created an issue. See original summary.

damienmckenna’s picture

Status: Active » Needs review
StatusFileSize
new680 bytes

This verifies that the application loads and that the init() call works before attempting to perform the search.

matthieuscarset’s picture

Status: Needs review » Fixed

Thank you for this issue and for the patch.

I have added a message for administrators only to explain why a Twitter block would appears empty - because of the connection issue with the Twitter app.

It's merged on 4.0.x and will be released soon.

damienmckenna’s picture

That's a good approach, thank you.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.