- Issue created by @fkelly
- last update
10 months ago Patch Failed to Apply - last update
10 months ago Patch Failed to Apply - πΊπΈUnited States fkelly
Obviously the first version of the patch failed miserably. Need a good version of the code up on the repository to apply to 4.0.x. Probably a week before I get to it because of other priorities.
- πΊπΈUnited States fkelly
Hopefully this corrects the errors in the storm.patch file uploaded previously.
- last update
10 months ago Patch Failed to Apply - πΊπΈUnited States fkelly
The "only" patch failures on this iteration were the overall info.yml and 8 of the programs in the tests directory, which I believe may not even be in the 4.0.x directory.
I will need help on the next steps: I could modify the patch to not include the failing programs but that is just avoiding the issue. I think that, substantively the patches are needed (though some may need further review) but not sure how to proceed. There doesn't seem to be a "branch" that I can use reliably to run the patch against .... if that's even needed. Or do I need to run a merge of some sort.
Many of the patches are "innocuous" things. A few, such as the ones getting rid of the deprecated watchdog function, do need review.
- πΊπΈUnited States fkelly
Review needed code:
Phpstorm frequently kicks off "error" messages that may or may not have an effect on the operation of the Juicebox code. Since I am not the most expert PHP coder, I'm reluctant to just "blindly" make changes that I don't fully understand.
Juicebox_load_js is once program that PHPSTORM has "reservations about". Here is an article that explains the issue(s).
https://www.linkedin.com/pulse/var-vs-let-const-easiest-explanation-ever....
Here is replacement code based on PHPstorm's suggestions. I'm not ready to promote it as a patch but rather to submit it for review.
/** * @file * Attaches the behaviors for the Juicebox module. */ class juicebox { constructor(newGallery) { } } (function ($, Drupal) { Drupal.behaviors.juicebox = { attach: function (context, settings) { if (typeof settings['juicebox'] !== 'undefined') { const galleries = settings['juicebox']; // Loop-through galleries that were added during this request. for (const key in galleries) { if (galleries.hasOwnProperty(key) && document.getElementById(key)) { // Instantiate each new gallery via the library. Take a copy to be // safe as we will delete the original settings reference after. const newGallery = $.extend({}, galleries[key]); new juicebox(newGallery); // We only want to hold on to the settings for this gallery long // enough to pass it on as a proper Juicebox object. In fact, // holding on longer can cause problems on sequential AJAX updates // of the same gallery, so it's probably best to delete it. delete galleries[key]; } } } } }; })(jQuery, Drupal);
- πΊπΈUnited States fkelly
The function watchdog_exception was deprecated for Drupal 10. In pre-Drupal 10 Juicebox code this function was used in 3 programs:
JuiceBoxXmlControllerField.php
JuiceBoxXmlControllerBase.php
JuiceBoxFieldFormatter.phpIn my patch in #5 I provided tentative replacements. The code "works" on my 10.2.2 test and production systems using the bleeding edge Juicebox Code with many of Luke's fixes in it. I'm not sure how to test further to see if issues that would have caused a watchdog exception to occur would be handled properly by my replacements. I could "quote" the code here but a more detailed review would be a better idea.
- πΊπΈUnited States fkelly
filtermarkup ...
JuiceBoxGallery.php contains a function that attempts to make sure that only html codes that are valid are allowed in a JuiceboxGallery.
protected function filterMarkup(string $markup): string {
// Set inline html5 elements that are safe in a Juicebox gallery. Ref:
// https://www.w3.org/html/wg/drafts/html/master/single-page.html#phrasing-content
$valid_elements = "