Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When using the module, I get a message in rollbar that I'm using an old version of rollbar.js. The attached patch uses the latest version and the message is removed in the rollbar dashboard.
Comment | File | Size | Author |
---|---|---|---|
#13 | rollbar-library-update-2639944-13-D7.patch | 6.8 KB | retrodans |
#12 | rollbar-library-update-2639944-12-D7.patch | 5.92 KB | retrodans |
#11 | rollbar-library-update-2639944-11-D7.patch | 4.79 KB | eddie_c |
rollbar-updgrade-version.patch | 5.64 KB | jesse.d |
Comments
Comment #2
vijaycs85Sorry, 7.x is minimally maintained and maintenance fixes only.
Comment #3
intrafusionThis patch is the definition of a maintenance fix:
If you're genuinely not going to apply this patch then the module should be marked No further development
Comment #4
eddie_c CreditAttribution: eddie_c at Oxfam International commented@vijaycs85 has kindly let me help maintain the 7.x branch of this module. When this has been RTBCd I'd be happy to apply it.
Comment #5
intrafusion@eddie_c, I doubt whether this can be marked RTBC as there are only 30 sites report using this module primarily as this has never had a stable release for 7.x
I can report that I applied this patch successfully myself, plus with a bit of manipulation managed to get the module to work with the latest Rollbar release (1.4.1) which requires installation via composer
Comment #6
eddie_c CreditAttribution: eddie_c at Oxfam International commented@intrafusion Great to hear that it works for you. Please could you expand on the manipulation you had to do to get it to work with Rollbar 1.4.1?
Comment #7
intrafusion@eddie_c it was fairly straightforward:
sites/all/libraries
before runninggit clone
rollbar.module
, there is a helper function_rollbar_get_library_path()
, I set the default value tosites/all/libraries/rollbar-php/vendor/autoload.php
rollbar_boot()
and one insiderollbar_watchdog()
, these calls need to be changed fromRollbar::
to\Rollbar\Rollbar::
These were the only steps I needed to take to get it working, however I discovered that if you try to upgrade a site which already has Rollbar installed there are serious errors, but if you install fresh it works without issue. I suspect that this due to the variable in
_rollbar_get_library_path()
returning the wrong path, etc.Comment #8
jesse.d CreditAttribution: jesse.d commentedWouldn't this patch be out of date at this point? I created it years ago and haven't really kept up with rollbar since as I haven't been on that project in a while. It seems like their quickstart snippet has evolved since then: see the quickstart js docs.
It may be worthwhile for someone that is currently using the service to reroll and do some initial testing with the updated quickstart snippet.
Comment #9
eddie_c CreditAttribution: eddie_c at Oxfam International commentedjesse.d This is a good point. Also, if we're going to upgrade the Rollbar PHP library as @intrafusion suggests then perhaps we should be using this method for integrating with Rollbar.js: https://github.com/rollbar/rollbar-php#integration-with-rollbarjs
My concern is that we'd be introducing a dependency on composer and I don't know if that's acceptable in a Drupal 7 module. Do you know?
Comment #10
jesse.d CreditAttribution: jesse.d commented@eddie_c the Composer Manager module was created for just that purpose actually.
Comment #11
eddie_c CreditAttribution: eddie_c at Oxfam International commentedThanks @jesse.d. Following up on your advice I've created a patch that introduces a dependency on Composer Manager in order to use the latest version of the PHP Rollbar library (which also includes a more up to date Rollbar.js).
As @intrafusion pointed out, this breaks backwards compatibility with Rollbar 7.x-1.x, so I suggest if we go with this solution we commit it to a new 7.x-2.x branch.
I've not tested this thoroughly yet, but initial testing shows I'm at least getting some messages showing successfully in rollbar.
Comment #12
retrodans CreditAttribution: retrodans commentedAn update of the previous patch to add in an extra class_exists() check to stop it failing
Comment #13
retrodans CreditAttribution: retrodans at Agile Collective for Oxfam International commentedAnother update, adding a missing composer.json file and a few other fixes
Comment #14
eddie_c CreditAttribution: eddie_c at Oxfam International commented@retrodans, Should the rollbar library version be pinned to v1.x or v1.7.x in order to avoid composer upgrading to a version that may not be compatible with the module in future?
Other than that, I've tested this and it appears to work well.
Comment #15
intrafusionPatch applied to new 7.x-2.x branch