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)

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
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | visitor-block.png | 247.04 KB | pooja_sharma |
Issue fork visitors-3400985
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
Comment #2
pooja_sharma commentedComment #3
pooja_sharma commentedComment #4
pooja_sharma commentedComment #5
avpadernoComment #6
pooja_sharma commentedThis 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
Comment #7
pooja_sharma commentedComment #10
bluegeek9 commentedComment #13
bluegeek9 commentedThis 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