Polls inserted manually into database don't work right


(Veer) #1

Please Note that, actually command create the HTML in the Posts.cooked but it do not work. I inserted polls in Posts.Raw (only the Markdown), With different poll names and options etc.
but the problem is Polls are really not workable when rebake the posts.

  • Polls do not work when inserted in the database and i run Rebake command.
  • While using the same markdown and editing a post with hand creats a poll nicely.

here is the screenshot of two polls, One inserted manually and another by rebaking ( just below it).

You can see the Vote now or show results is not working here.


(Jeff Atwood) #2

I have edited your title to make it more correct. Pray I do not edit it again :wink:

Inserting stuff manually into the DB is always going to be sketchy.


(Jay Pfaffman) #3

You’ll likely be happier if you do that via the API than manipulating the database.


(Veer) #4

Is it practically possible with API if i have more than million posts ?


(Jay Pfaffman) #5

You want to add this poll to all Million of them? Is this a recent import? if so, could you do it again and insert your poll as part of the import?


(Veer) #6

Sir, its not a single poll, Multiple polls, almost one per topic, more than 0.3 million posts. Thats the problem. API will take long long time in so. add markdown according topic id in pgsql command and then rebaking is better option. But rebaking is really not helping, Reimporting is also a longer task for me.


(Jay Pfaffman) #7

Ah. Yeah. That’s tricky. Sounds like that could be the solution, if you can get it to work.

If you rebuild html from the web interface, does the Right Thing happen? If so, then you can deal with tweaking your rebake match call.


(Veer) #8

rebuilding html from webinterface is also not working. :frowning: How ever once editing and submitting is working.


(Dean Taylor) #9

Check to see if you have any blacklog in Sidekiq that might be delaying the updating.

You can check the status of Sidekiq by visiting your /sidekiq/ page for your install.

Top of the page will look something like this:


(Veer) #10

UnSolved.
post_custom_fields
should be populated according to the polls markdown. But this is not getting populated by the rebake command. Rebake is only creating the HTML. Not populating the other table.
But web interface edit button is doing that.

No sidekiq process is busy or in que.


(Veer) #11

Solved, check here how.