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

Initial edit not saving #146

Open
bitstein opened this issue Jul 15, 2017 · 4 comments
Open

Initial edit not saving #146

bitstein opened this issue Jul 15, 2017 · 4 comments

Comments

@bitstein
Copy link

I am reposting this from the Google Group email list (original here):

Hey guys,

I was very happy to find Waliki. It looks like a really promising project with many of the features I'd like in a wiki. When setting up a basic site as per the README, I came across some interesting behavior. When I create a new page, the empty markdown file is created, but I am unable to save the file after an initial edit. Interestingly, when I went into the Waliki source code and made an edit to views.py, I was able to make things function fine. What I did was change the raw page value here (https://github.com/mgaitan/waliki/blob/master/waliki/views.py#L125) from an empty string to a single space (" "). This saved the file as such (a single space, rather than empty), and the form submission worked fine after. I'd of course prefer if the file was initially saved as empty.

Do you know why this might be happening?

Thanks,
Michael

@rudyryk
Copy link

rudyryk commented Nov 3, 2017

Seems like there's a JavaScript error, I get the following message in debug console:

An invalid form control with name='raw' is not focusable.

screen shot 2017-11-03 at 16 28 09

@rudyryk
Copy link

rudyryk commented Nov 3, 2017

As I can understand because of this bug new pages creation is completely broken at the moment.

@l-dfa
Copy link

l-dfa commented May 24, 2018

Hi all,

trying ver 0.9.dev0, creating a new page using reStructuredText I get the error:

...
Django Version: 	2.0.2
Exception Type: 	AttributeError
Exception Value:'ReStructuredTextMarkup' object has no attribute 'get_document_body'
Exception Location: 	C:\Dati\Studio\Sviluppi\Unavox\venv\lib\site-packages\waliki\models.py in _get_part, line 135
...

Is this the same kind of error from Michael?

maybe something broken in _markups.py inheriting from MarkdownMarkupBase ?

thank you
ldfa

@frenchbeard
Copy link

frenchbeard commented Feb 1, 2019

@bitstein The reason for this behaviour (the creation issue) seems to lie with git, which doesn't care about an empty file (if you only "touch" a file of size zero in a git repo, it won't be tracked, even less staged, so the database contradicts the git repository information).
@l-dfa There seems to be an issue in the way the body is fetched in models.py : currently, through

Page._get_part(self, part)

which results in a call to

getattr(self.markup_, 'get_document_body')(self.raw)

when the get_document_body only exists as a result in Converted[MarkupName], which would be the markup.ConvertedReStructruredText for your case, so more something like that

 getattr(self.markup_.convert(self.raw), 'get_document_body')

There was also a missing parameter in the signal sent on page_saved, but I have to dig into that. I made a mess of a commit fixing a couple of things and readying it for python3, but the pdf generation still requires python2 (rst2pdf being how it is).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants