Problem/Motivation

The website encountered an unexpected error. Please try again later.

InvalidArgumentException: The timestamp must be numeric. in Drupal\Component\Datetime\DateTimePlus::createFromTimestamp() (line 201 of core/lib/Drupal/Component/Datetime/DateTimePlus.php).
Drupal\Core\Datetime\DateFormatter->format(NULL, 'short') (Line: 367)
Drupal\visitors\Plugin\Block\VisitorsBlock->showSinceDate() (Line: 155)
Drupal\visitors\Plugin\Block\VisitorsBlock->build() (Line: 171)
Drupal\block\BlockViewBuilder::preRender(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 788)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 374)

visiors-block

Steps to reproduce

1. install and enabled module
2. Add "visitor" block from back-end
3, Then hit any page on which visitor block placed
4. You 'll get above mentioned error on page & page 'll be broken

Proposed resolution

In showSinceDate() function of "VisitorsBlock" block need to add check if since_date variable value exist only then since_date variable need to pass in to this function: $this->dateFormatter->format()

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#3 visitor-block.png247.04 KBpooja_sharma

Issue fork visitors-3400985

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

pooja_sharma created an issue. See original summary.

pooja_sharma’s picture

Assigned: Unassigned » pooja_sharma
pooja_sharma’s picture

Issue summary: View changes
StatusFileSize
new247.04 KB
pooja_sharma’s picture

Issue summary: View changes
avpaderno’s picture

Version: 8.x-2.16 » 8.x-2.x-dev
Issue tags: -page break
pooja_sharma’s picture

Version: 8.x-2.x-dev » 8.x-2.16
Assigned: pooja_sharma » Unassigned

This branch "8.x-2.x-dev" pipeline already broken , can check here https://git.drupalcode.org/project/visitors, code not able to merge until pipeline issue fixed

pooja_sharma’s picture

Version: 8.x-2.16 » 8.x-2.x-dev

bluegeek9 made their first commit to this issue’s fork.

bluegeek9’s picture

Status: Active » Fixed
//www.flaticon.com/free-icons/thank-you Thank you for your contribution! Your continued support to this project makes other volunteer contributions more sustainable.
There are multiple ways to show appreciation for the work contributed to this project including:
  • Triaging issues and adding more context to existing issues.
  • Writing documentation or patches for this project.

  • bluegeek9 committed de766a08 on 8.x-2.x
    Issue #3400985 by bluegeek9: Site break when placed visitors module
    

Status: Fixed » Closed (fixed)

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

bluegeek9’s picture

This issue was resolved. A new release, 8.x-2.17, will be made soon, May 31st.

This is an excellent opportunity to beta test the dev branch, and report any issues.

Contributors (5)

bluegeek9, roshni27, abhishek_gupta1, sarwan_verma, SandeepSingh199

Changelog

Issues: 32 issues resolved.

Changes since 8.x-2.16:

Bug

Feature

Task