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

encode jobs that have an array as job value #35224

Merged
merged 1 commit into from
May 15, 2019
Merged

Conversation

patrickjahns
Copy link
Contributor

@patrickjahns patrickjahns commented May 14, 2019

Description

If the argument of a job is an array, json_encode it

Related Issue

Motivation and Context

Fix #35222

How Has This Been Tested?

  • 🤖

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Database schema changes (next release will require increase of minor version instead of patch)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

Open tasks:

  • Backport (if applicable set "backport-request" label and remove when the backport was done)

Copy link
Contributor

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@individual-it
Copy link
Member

---------- begin diff ----------
--- Original
+++ New
@@ -45,8 +45,8 @@
 	}
 
 	private function getJobArgumentAsString($argument) {
-		if (is_array($argument)) {
-			$argument = json_encode($argument);
+		if (\is_array($argument)) {
+			$argument = \json_encode($argument);
 		}
 		return $argument;
 	}

----------- end diff -----------

Signed-off-by: Patrick Jahns <github@patrickjahns.de>
@codecov
Copy link

codecov bot commented May 14, 2019

Codecov Report

Merging #35224 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #35224      +/-   ##
============================================
+ Coverage     65.53%   65.54%   +<.01%     
- Complexity    18645    18647       +2     
============================================
  Files          1218     1218              
  Lines         70540    70544       +4     
  Branches       1288     1288              
============================================
+ Hits          46231    46235       +4     
  Misses        23932    23932              
  Partials        377      377
Flag Coverage Δ Complexity Δ
#javascript 53.69% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 66.9% <100%> (ø) 18647 <2> (+2) ⬆️
Impacted Files Coverage Δ Complexity Δ
core/Command/Background/Queue/Status.php 100% <100%> (ø) 6 <2> (+2) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7e920e3...c46bff8. Read the comment docs.

1 similar comment
@codecov
Copy link

codecov bot commented May 14, 2019

Codecov Report

Merging #35224 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #35224      +/-   ##
============================================
+ Coverage     65.53%   65.54%   +<.01%     
- Complexity    18645    18647       +2     
============================================
  Files          1218     1218              
  Lines         70540    70544       +4     
  Branches       1288     1288              
============================================
+ Hits          46231    46235       +4     
  Misses        23932    23932              
  Partials        377      377
Flag Coverage Δ Complexity Δ
#javascript 53.69% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 66.9% <100%> (ø) 18647 <2> (+2) ⬆️
Impacted Files Coverage Δ Complexity Δ
core/Command/Background/Queue/Status.php 100% <100%> (ø) 6 <2> (+2) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7e920e3...c46bff8. Read the comment docs.

@phil-davis
Copy link
Contributor

Backport stable10 PR #35225
Backport release-10.2.9.0 PR #35228

@individual-it
Copy link
Member

CC @paurakhsharma please adjust the tests you are writing accordingly

@lock lock bot locked as resolved and limited conversation to collaborators May 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error thrown when running occ background:queue:status
4 participants