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

InfoParser not properly parsing single background-job, single command, etc #26760

Closed
PVince81 opened this issue Dec 2, 2016 · 7 comments
Closed

Comments

@PVince81
Copy link
Contributor

PVince81 commented Dec 2, 2016

Steps

  1. Add a breakpoint in lib/private/InfoParse->parse()
  2. Open the web UI
  3. When at the breakpoint, continue until it stops for either the files_trashbin or files_versions app
  4. Evaluate $array['background']['job'] and notice that it's not an array because it's a single item
  $array['background-jobs']      = (array[1]);
    $array['background-jobs']['job'] = (string[44]) 'OCA\Files_Trashbin\BackgroundJob\ExpireTrash';

When there is more than one item then it becomes an array...

For some reason the bkg job is still registered properly, but I'm not sure about the other parts.

Discovered while working on #26195 where I'll add a new sabre XML entry.

@DeepDiver1975 this is a potential issue with any of the new info.xml tags you have added, please have a look.

@PVince81
Copy link
Contributor Author

PVince81 commented Dec 2, 2016

When did you add these new entries, hopefully only 9.2 ? Would be good to double check them all and see if they are parsed properly for single items.

Setting as critical until we can confirm that all still works properly, somehow...

@DeepDiver1975 please have a look, thanks.

@PVince81
Copy link
Contributor Author

PVince81 commented Dec 2, 2016

Just checked for commands, and it works but it's only by sheer luck.
This is from loadCommandsFromInfoXml($commands):

$commands                        = (array[1]);
  $commands['command']           = (string[49]) 'OCA\Federation\Command\SyncFederationAddressBooks';


// by property_get
$commands                        = (array[3]);
  $commands[0]                   = (string[22]) 'OCA\Files\Command\Scan';
  $commands[1]                   = (string[37]) 'OCA\Files\Command\DeleteOrphanedFiles';
  $commands[2]                   = (string[35]) 'OCA\Files\Command\TransferOwnership';

sometimes the index is a number, sometimes it's just command when it's a single item... a bug that cancels another one ?

@PVince81
Copy link
Contributor Author

PVince81 commented Dec 2, 2016

or maybe this is all by design... would be good if you could confirm.

@DeepDiver1975
Copy link
Member

This codeblock is making sure this properly is populated:
https://github.com/owncloud/core/blob/master/lib/private/App/InfoParser.php#L124-L126

@PVince81
Copy link
Contributor Author

PVince81 commented Dec 5, 2016

Yeah, I figured that out in the end... a bit obscure but ok

@PVince81 PVince81 closed this as completed Dec 5, 2016
@DeepDiver1975
Copy link
Member

a bit obscure but ok

I know - but this is how the xml parser works ...

@lock
Copy link

lock bot commented Jul 31, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

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

No branches or pull requests

3 participants