Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS error when loading history through reports #142

Open
jedimonkey opened this issue Dec 31, 2019 · 3 comments
Open

JS error when loading history through reports #142

jedimonkey opened this issue Dec 31, 2019 · 3 comments

Comments

@jedimonkey
Copy link

I've installed this module to allow history access to elemental blocks (as there is an issue with the SS4 implementation and accessing the history of page blocks). So this module works fine, however accessing anything through the 'Reports' system has a javascript error when you click through to an item.

image

image

Clicking on any content (block or page) has a js error:
image

Clicking on the history shows a black view - as the JS HistoryViewer component didn't load
image

Reloading the page and it works fine:
image

I dug into the code a bit and can see that it's loading the JS and CSS after loading the view, however there is a race condition and it hasn't loaded / processed the JS in time when it's processing the view. Any idea how to fix this?

thanks!

@brynwhyman
Copy link

Hi @jedimonkey, do you mind sharing the versions of Silverstripe modules that you're running? You can run composer show in the root directory of your project.

I can't seem to recreate the JS error with the following steps:

silverstripe/framework  4.5.0
silverstripe/versioned 1.5.0
silverstripe/versioned-admin  1.3.0
dnadesign/silverstripe-elemental  4.3.0
  1. Create content block page with history records
  2. Access the page via the Content blocks in use report either the 'Title' or 'Page' links
  3. Observe no JS error related to the History Viewer. History tab shows results as expected.

@jedimonkey
Copy link
Author

Hi @brynwhyman, Sorry for the delay, been on leave and then came back to crazy amount of work.

Here is the (long) list of plugins:

composer show
asyncphp/doorman                               3.0.0              Child process management
axllent/silverstripe-scss                      1.3.1              A wrapper for scssphp to integrate scss compiling directly into SilverStripe
bramus/ansi-php                                3.0.3              ANSI Control Functions and ANSI Control Sequences (Colors, Erasing, etc.) for PHP CLI Apps
bramus/monolog-colored-line-formatter          2.0.3              Colored Line Formatter for Monolog
composer/ca-bundle                             1.2.5              Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.
composer/installers                            v1.7.0             A multi-framework Composer library installer
dnadesign/silverstripe-elemental               4.3.0              Elemental pagetype and collection of Elements
dnadesign/silverstripe-elemental-list          1.2.0              Adds a new element for nested elements
dnadesign/silverstripe-elemental-userforms     dev-master e7d973c Adds a new element for usersforms
dnadesign/silverstripe-elemental-virtual       dev-master d71fa5d Adds ability for Elemental to share content blocks between pages
doctrine/instantiator                          1.3.0              A small, lightweight utility to instantiate objects in PHP without invoking their constructors
dynamic/silverstripe-elemental-blog            2.1.2              Show recent posts from a featured blog.
embed/embed                                    v3.4.2             PHP library to retrieve page info using oembed, opengraph, etc
firesphere/solr-search                         1.0-beta5          Search a SilverStripe site with Solr
guzzlehttp/guzzle                              6.5.2              Guzzle is a PHP HTTP client library
guzzlehttp/promises                            v1.3.1             Guzzle promises library
guzzlehttp/psr7                                1.6.1              PSR-7 message implementation that also provides common utility methods
intervention/image                             2.5.1              Image handling and manipulation library with support for Laravel integration
jeremeamia/superclosure                        2.4.0              Serialize Closure objects, including their context and binding
league/csv                                     8.2.3              Csv data manipulation made easy in PHP
league/flysystem                               1.0.62             Filesystem abstraction: Many filesystems, one API.
m1/env                                         2.1.2              Env is a lightweight library bringing .env file parser compatibility to PHP. In short - it enables you to read .env files with PHP.
marcj/topsort                                  1.1.0              High-Performance TopSort/Dependency resolving algorithm
minimalcode/search                             1.0.1              Fluent Lucene-Sorl Query Builder for PHP
monolog/monolog                                1.25.3             Sends your logs to files, sockets, inboxes, databases and various web services
myclabs/deep-copy                              1.9.4              Create deep copies (clones) of your objects
nikic/php-parser                               v4.3.0             A PHP parser written in PHP
paragonie/random_compat                        v2.0.18            PHP 5.x polyfill for random_bytes() and random_int() from PHP 7
phpdocumentor/reflection-common                2.0.0              Common reflection classes used by phpdocumentor to reflect the code structure
phpdocumentor/reflection-docblock              4.3.4              With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.
phpdocumentor/type-resolver                    1.0.1              A PSR-5 based resolver of Class names, Types and Structural Element Names
phpspec/prophecy                               1.10.1             Highly opinionated mocking framework for PHP 5.3+
phpunit/php-code-coverage                      4.0.8              Library that provides collection, processing, and rendering functionality for PHP code coverage information.
phpunit/php-file-iterator                      1.4.5              FilterIterator implementation that filters files based on a list of suffixes.
phpunit/php-text-template                      1.2.1              Simple template engine.
phpunit/php-timer                              1.0.9              Utility class for timing
phpunit/php-token-stream                       2.0.2              Wrapper around PHP's tokenizer extension.
phpunit/phpunit                                5.7.27             The PHP Unit Testing framework.
phpunit/phpunit-mock-objects                   3.4.4              Mock Object library for PHPUnit
psr/cache                                      1.0.1              Common interface for caching libraries
psr/container                                  1.0.0              Common Container Interface (PHP FIG PSR-11)
psr/event-dispatcher                           1.0.0              Standard interfaces for event handling.
psr/http-message                               1.0.1              Common interface for HTTP messages
psr/log                                        1.1.2              Common interface for logging libraries
psr/simple-cache                               1.0.1              Common interfaces for simple caching
ralouphie/getallheaders                        3.0.3              A polyfill for getallheaders.
scssphp/scssphp                                1.0.6              scssphp is a compiler for SCSS written in PHP.
sebastian/code-unit-reverse-lookup             1.0.1              Looks up which function or method a line of code belongs to
sebastian/comparator                           1.2.4              Provides the functionality to compare PHP values for equality
sebastian/diff                                 1.4.3              Diff implementation
sebastian/environment                          2.0.0              Provides functionality to handle HHVM/PHP environments
sebastian/exporter                             2.0.0              Provides the functionality to export PHP variables for visualization
sebastian/global-state                         1.1.1              Snapshotting of global state
sebastian/object-enumerator                    2.0.1              Traverses array structures and object graphs to enumerate all referenced objects
sebastian/recursion-context                    2.0.0              Provides functionality to recursively process PHP variables
sebastian/resource-operations                  1.0.0              Provides a list of PHP built-in functions that operate on resources
sebastian/version                              2.0.1              Library that helps with managing the version number of Git-hosted PHP projects
sheadawson/silverstripe-dependentdropdownfield 2.0.0              A silverstripe dropdown field that has it's options populated via ajax, based on the value of the field it depends on
silverstripe-themes/simple                     3.2.0              The SilverStripe simple theme (default SilverStripe 3 theme)
silverstripe/admin                             1.4.1              SilverStripe admin interface
silverstripe/asset-admin                       1.4.1              Asset management for the SilverStripe CMS
silverstripe/assets                            1.4.1              SilverStripe Assets component
silverstripe/blog                              3.5.0              A fresh take on blogging in Silverstripe set out to tackle the issue of a cluttered Site Tree.
silverstripe/campaign-admin                    1.4.1              SilverStripe campaign admin interface
silverstripe/cms                               4.4.1              The SilverStripe Content Management System
silverstripe/config                            1.0.15             SilverStripe configuration based on YAML and class statics
silverstripe/elemental-bannerblock             2.0.2              A banner block for the silverstripe-elemental module
silverstripe/elemental-fileblock               2.0.0              A file block for the silverstripe-elemental module
silverstripe/errorpage                         1.4.1              ErrorPage component for SilverStripe CMS
silverstripe/framework                         4.4.1              The SilverStripe framework
silverstripe/graphql                           3.1.1              GraphQL server for SilverStripe models and other data
silverstripe/lumberjack                        2.0.1              A module to make managing pages in a GridField easy without losing any of the functionality that you're used to in the CMS.
silverstripe/recipe-cms                        4.4.1              SilverStripe recipe for fully featured page and asset content editing
silverstripe/recipe-core                       4.4.1              SilverStripe framework-only core recipe
silverstripe/recipe-plugin                     1.3.0              Helper plugin to install SilverStripe recipes
silverstripe/reports                           4.4.1              Reports module for SilverStripe CMS
silverstripe/restfulserver                     dev-master a6f2162 Add a RESTful API to your SilverStripe application
silverstripe/segment-field                     2.2.3              A reusable approach to segment-generating fields
silverstripe/siteconfig                        4.4.1              Site wide settings administration.
silverstripe/tagfield                          2.4.0              Tag field for SilverStripe
silverstripe/taxonomy                          2.0.2              Provide extra taxonomy for cataloguing the data.
silverstripe/userforms                         5.5.0              UserForms enables CMS users to create dynamic forms via a drag and drop interface and without getting involved in any PHP code
silverstripe/vendor-plugin                     1.4.1              Allows vendor modules to expose directories to the webroot
silverstripe/versioned                         1.4.1              SilverStripe Versioned component
silverstripe/versioned-admin                   1.2.1              SilverStripe versioned admin interface
silverstripe/widgets                           2.0.2              Widgets are small pieces of functionality such as showing the latest Comments or Flickr Photos. They normally display on the sidebar of your website.
solarium/solarium                              5.1.5              PHP Solr client
stevie-mayhew/silverstripe-svg                 2.2.0              Basic SVG support for SilverStripe
swiftmailer/swiftmailer                        v5.4.12            Swiftmailer, free feature-rich PHP mailer
symbiote/silverstripe-gridfieldextensions      3.2.2              A collection of useful grid field components
symbiote/silverstripe-queuedjobs               4.4.2              A framework for defining and running background jobs in a queued manner
symfony/cache                                  v3.4.36            Symfony Cache component with PSR-6, PSR-16, and tags
symfony/config                                 v3.4.36            Symfony Config Component
symfony/event-dispatcher                       v5.0.2             Symfony EventDispatcher Component
symfony/event-dispatcher-contracts             v2.0.1             Generic abstractions related to dispatching event
symfony/filesystem                             v4.4.2             Symfony Filesystem Component
symfony/finder                                 v3.4.36            Symfony Finder Component
symfony/polyfill-apcu                          v1.13.1            Symfony polyfill backporting apcu_* functions to lower PHP versions
symfony/polyfill-ctype                         v1.13.1            Symfony polyfill for ctype functions
symfony/polyfill-mbstring                      v1.13.1            Symfony polyfill for the Mbstring extension
symfony/polyfill-php56                         v1.13.1            Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions
symfony/polyfill-util                          v1.13.1            Symfony utilities for portability of PHP codes
symfony/translation                            v2.8.52            Symfony Translation Component
symfony/yaml                                   v3.4.36            Symfony Yaml Component
tractorcow/silverstripe-autocomplete           4.0.0              Autocomplete text field for Silverstripe
undefinedoffset/sortablegridfield              2.0.8              Adds drag and drop functionality to SilverStripe 4.x's GridField
webmozart/assert                               1.6.0              Assertions to validate method input/output with nice error messages.
webonyx/graphql-php                            v0.12.6            A PHP port of GraphQL reference implementation

@michalkleiner
Copy link

Hi @jedimonkey, could you check if this is still an issue with the latest version of the CMS and the module (4.12 and 1.12 respectively as of today)?

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

No branches or pull requests

5 participants