Notice: Undefined index: username in twitter_block_block_view()

Created on 16 September 2014, over 9 years ago
Updated 26 January 2023, over 1 year ago

After the addition of the Twitter account name to 2.2, blocks that were created before this change will issue a warning of E_NOTICE:

Notice: Undefined index: username in twitter_block_block_view() (line 407 of /example.com/sites/all/modules/twitter_block/twitter_block.module).

This patch adds 1) a sanity check to hook_block_view() to check that we have the widget_id and data array before rendering the block and 2) a fallback username from the previous versions of Twitter Block (@twitterapi) for those blocks that have not yet been updated with a username.

πŸ› Bug report
Status

Closed: outdated

Version

2.0

Component

Code

Created by

πŸ‡©πŸ‡°Denmark achton Denmark

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Closing as outdated as D10 just released so focus will be going toward D9/D10 support mainly.

    Will keep an eye on the 7.x branch for reviews.

Production build 0.69.0 2024