Skip to content
This repository was archived by the owner on Dec 11, 2025. It is now read-only.

"fix" ☠ Unknown ID trash. Inconsitent meta data#18

Closed
nemiah wants to merge 1 commit intosplitbrain:masterfrom
nemiah:master
Closed

"fix" ☠ Unknown ID trash. Inconsitent meta data#18
nemiah wants to merge 1 commit intosplitbrain:masterfrom
nemiah:master

Conversation

@nemiah
Copy link
Contributor

@nemiah nemiah commented Sep 12, 2020

Hi,

i got the error "☠ Unknown ID trash. Inconsitent meta data" when uploading a pdf file.
Looks like a trash was added a while ago. I don't know if this "fix" does break something else, uploads work again for me 🤷‍♀️ 😊

Best,
Nena

{
if (!isset($this->index[$id])) throw new \Exception("Unknown ID $id. Inconsitent meta data");
if($id == "trash")
return "";
Copy link

@ohad ohad Dec 29, 2020

Choose a reason for hiding this comment

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

Here's a proposed different fix. Later, change as follows:

         if ($item['Parent'] === '') {
             // top level item
             $item['Path'] = '/' . $item['VissibleName'];
+        } else {if ($item['Parent'] === 'trash') {
+           // trash item
+           $item['Path'] = 'trash/' . $item['VissibleName'];
         } else {
             // recursion
             $item['Path'] = $this->calcPath($item['Parent']) . '/' . $item['VissibleName'];
-        }
+        }}

This doesn't actually work (though it stops crashing on my machine), but the point is to return a sensible path rather than an empty path.
(Unless the empty path is actually correct --- I'm not an expert in this API, just proposing a slightly different way to do this.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No problem, I just needed a solution that works and I thougt I'd share it if someone is interested 😊 I don't know either what's the right solution here 🤷‍♀️

splitbrain added a commit that referenced this pull request Jun 3, 2021
This is a somewhat ugly workaround for the 'trash' folder problem
mentioned in #18, but it works fine so far.
@splitbrain
Copy link
Owner

I pushed a different workaround, so I'm closing this. I guess proper trash support would be cool. PRs welcome

@splitbrain splitbrain closed this Jun 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants