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

Erroneous bulk importing when using the OneMore File/Import menu #848

Closed
MirisWisdom opened this issue Jan 28, 2023 · 7 comments · Fixed by #849 or #855
Closed

Erroneous bulk importing when using the OneMore File/Import menu #848

MirisWisdom opened this issue Jan 28, 2023 · 7 comments · Fixed by #849 or #855
Assignees
Labels
bug Something isn't working released Available in a released installer

Comments

@MirisWisdom
Copy link

MirisWisdom commented Jan 28, 2023

Previous Title: Batch .md Importing Results in Blank Page

To the new souls stumbling upon this:

This issue initially focused on Markdown files being imported in bulk. We've discovered that the bug happens when using the OneMore File/Import menu. The bug also affects Word files imported in bulk. The solution is to use the command palette (Ctrl + Shift + P) -> Import.

Describe the bug

When importing multiple Markdown files (i.e. C:\Path\To\File*.md), blank pages are introduced for each Markdown file. Importing the Markdown files one by one actually works! This problem occurs only when importing in batch.

To Reproduce

Steps to reproduce the behavior:

  1. Go to 'File';
  2. Click on 'Import';
  3. Specify a path to multiple Markdown files, and use the wildcard;
  4. See the pages being blank.

Expected behavior

The headings and paragraphs should be introduced.

Screenshots

image

Environment (if applicable):

  • OneNote Version: 16.0.15831.20208
  • OneMore Version 5.4.4

Additional context

The Markdown files are pretty rudimentary:

# Some Heading

Some super nifty - although probably verbose - paragraphs go here...

Log file (doesn't show errors, curiously):

27860:6] Log restarted
27860:6] Running command ImportCommand
27860:18] ..running action...
27860:18] ..importing markdown D:\journal\2022\20220105.md
27860:17] ..importing markdown D:\journal\2022\20220119.md
27860:16] ..importing markdown D:\journal\2022\20220126.md
27860:8] ..importing markdown D:\journal\2022\20220129.md
27860:15] ..importing markdown D:\journal\2022\20220130.md
27860:8] ..importing markdown D:\journal\2022\20220131.md
27860:13] ..completed action (True)
27860:6] ..markdown file(s) imported @ 00:03.27

XML file (not much to see!):

<one:Page xmlns:one="http://schemas.microsoft.com/office/onenote/2013/onenote" ID="{7ED27894-48BB-4E19-BF81-FA7C1933268C}{1}{E1946316067805892885121979297967476789013871}" name="20220105" dateTime="2023-01-28T03:03:25.000Z" lastModifiedTime="2023-01-28T03:03:26.000Z" pageLevel="1" isCurrentlyViewed="true" selected="all">
  <one:QuickStyleDef index="0" name="PageTitle" fontColor="automatic" highlightColor="automatic" font="Calibri Light" fontSize="20.0" spaceBefore="0.0" spaceAfter="0.0" />
  <one:PageSettings RTL="false" color="automatic">
    <one:PageSize>
      <one:Automatic />
    </one:PageSize>
    <one:RuleLines visible="false" />
  </one:PageSettings>
  <one:Title selected="partial" lang="en-GB">
    <one:OE selected="all" alignment="left" quickStyleIndex="0">
      <one:T selected="all"><![CDATA[20220105]]></one:T>
    </one:OE>
  </one:Title>
</one:Page>
@MirisWisdom MirisWisdom added bug Something isn't working unread I have seen it or had time to refine it yet labels Jan 28, 2023
@stevencohn stevencohn removed the unread I have seen it or had time to refine it yet label Jan 28, 2023
@stevencohn stevencohn self-assigned this Jan 28, 2023
@stevencohn stevencohn linked a pull request Jan 28, 2023 that will close this issue
@stevencohn stevencohn added next-release Addressed but not yet released released Available in a released installer and removed next-release Addressed but not yet released labels Jan 28, 2023
@MirisWisdom
Copy link
Author

Howdy!

I've given 5.5.0 a whirl to see if it's all working now. As per your code, OneNote is in the main focus rather than the progress bar; however, the pages still end up being blank.

I've made sure to not do anything at all after clicking Ok in the import dialogue -- so that I don't interfere with the paste operation. For the sake of precaution, I also closed every other program. I took it to a paranoid level and disconnected my other screens as well!

Currently on Windows 11 -- if you need any further information or want me to try something out, please don't hesitate to let me know.

@stevencohn
Copy link
Owner

Ugh, sorry. I've tested it every way I can think of. I must be missing something. Would you mind sharing your .md files on a file share service somewhere?

@MirisWisdom
Copy link
Author

Hey friend, absolutely -- here you go: onemore-stubborn-markdowns.zip

They'll import fine when importing one by one (C:\onemore-stubborn-markdowns\202201.md), but no luck when doing it in batch (C:\onemore-stubborn-markdowns\*.md)... Debating whether it's an issue with the files themselves, or if it's something else altogether.

@stevencohn stevencohn reopened this Jan 30, 2023
@stevencohn
Copy link
Owner

I'm so used to using the command palette that that is how I've been doing all of my testing. And it works when invoking the Import command from the command palette!

It doesn't work when running from the OneMore File/Import menu. Until I figure out why... give it a try from the command palette by pressing Ctrl+Shift+P and typing Import

@MirisWisdom
Copy link
Author

No way, that actually worked. As you've said, using the palette works flawlessly, whereas doing it manually through the More -> File -> Import menu doesn't. I've tried it a few times as well, and I can reproduce this each time.

Good luck on fixing it -- absolutely love the add-on and your immediate response and dedication!

@MirisWisdom
Copy link
Author

Slightly off-topic (happy to create a new issue for this, or simply rename this one)

It seems like the File/Import menu is causing quirks with Word files as well:

  1. Some .docx files are skipped on the initial import
  2. This error shows up on the reattempted import:

image

I've attached some sample Word files for you -- you might have to import them a few times for the skipping to start. When it happens, importing again should show the aforementioned errors.

The workaround is to import the files using the palette, just like with the .md files.

To avoid Word erroring out on the subsequent import, you'll have to move or rename the files.

onemore-stubborn-word-docs.zip

I also noticed that OneNote refreshes each time a page is added when using the palette, but not when using the menu. I wonder if that somehow correlates!

@MirisWisdom MirisWisdom changed the title Batch .md Importing Results in Blank Pages Erroneous bulk importing when using the OneMore File/Import menu Jan 30, 2023
@stevencohn
Copy link
Owner

Good news. I have a solution that will be out in the next release.

@stevencohn stevencohn added next-release Addressed but not yet released and removed released Available in a released installer labels Jan 30, 2023
@stevencohn stevencohn linked a pull request Jan 30, 2023 that will close this issue
@stevencohn stevencohn added released Available in a released installer and removed next-release Addressed but not yet released labels Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released Available in a released installer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants