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

Couldn't find template for digesting: attachments/preview_office #15

Open
pr0l opened this issue Oct 18, 2019 · 14 comments
Open

Couldn't find template for digesting: attachments/preview_office #15

pr0l opened this issue Oct 18, 2019 · 14 comments

Comments

@pr0l
Copy link

pr0l commented Oct 18, 2019

Hey. Does not show the file. Reinstalled LibreOffice.
Ububntu 18.04
Redmine version 3.4.4.stable
Ruby version 2.4.1-p111 (2017-03-22) [x86_64-linux]
Rails version 4.2.8
Environment production
Database adapter Mysql2
redmine_preview_office 1.0.3

cat ./production.log 
Started GET "/issues/undefined11243?issue_id=11243&_=1571257313327" for 94.180.160.236 at 2019-10-16 23:21:56 +0300
Started POST "/ajax_counters/counters" for 94.180.160.236 at 2019-10-16 23:21:56 +0300
Processing by IssuesController#show as JS
  Parameters: {"issue_id"=>"11243", "_"=>"1571257313327", "id"=>"undefined11243"}
  Current user: admin (id=1)
Started GET "/attachments/preview_office/10481" for 94.180.160.236 at 2019-10-16 23:21:57 +0300
  Rendered common/error.html.erb (0.6ms)
Filter chain halted as :find_issue rendered or redirected
Completed 404 Not Found in 102ms (Views: 8.4ms | ActiveRecord: 13.5ms)
Processing by AjaxCountersController#counters as JSON
  Parameters: {"counters"=>["17e931ec4650adbf9dd1e740717854fc", "8afabb878df82ab70b90895578e6c8e8", "3086ee8126035e5e23490275a08f0258"]}
Started POST "/ajax_counters/counters" for 94.180.160.236 at 2019-10-16 23:21:57 +0300
Processing by AjaxCountersController#counters as JSON
  Parameters: {"counters"=>["17e931ec4650adbf9dd1e740717854fc", "8afabb878df82ab70b90895578e6c8e8", "3086ee8126035e5e23490275a08f0258"]}
  Current user: admin (id=1)
  Current user: admin (id=1)
Processing by AttachmentsController#preview_office as HTML
  Parameters: {"id"=>"10481"}
  Current user: admin (id=1)
  Couldn't find template for digesting: attachments/preview_office
Completed 304 Not Modified in 96ms (ActiveRecord: 16.9ms)
Completed 200 OK in 200ms (Views: 0.2ms | ActiveRecord: 28.6ms)

@pr0l pr0l closed this as completed Oct 18, 2019
@pr0l
Copy link
Author

pr0l commented Oct 18, 2019

chrome 77.0.3865.120 not work, in other browsers everything works

@pr0l pr0l reopened this Oct 18, 2019
@pr0l
Copy link
Author

pr0l commented Nov 10, 2019

Hi, as I understand it, the problem was in the script working incorrectly, it did not correctly read resizeObject (obj). Therefore, the value in the style of the hight parameter is 0. I deleted the script in the office.html.erb file and added ",: size => 800". Happened


# cat ./office.html.erb
<% = render: layout => 'layouts / file' do%>
   <% = preview_office_tag @attachment,: size => 800%>
<% end%>

after that everything works.

@kyuferev
Copy link

Thanks @pr0l for your solution. After a few minor edits (see below) document preview works in Chrome.

# cat app/views/attachments/office.html.erb
<%= render :layout => 'layouts/file' do %>
   <%= preview_office_tag @attachment, :size => 800%>
<% end %>

@muradurm
Copy link

muradurm commented Dec 6, 2019

Thanks @pr0l for your solution. After a few minor edits (see below) document preview works in Chrome.

# cat app/views/attachments/office.html.erb
<%= render :layout => 'layouts/file' do %>
   <%= preview_office_tag @attachment, :size => 800%>
<% end %>

redmine v3.4.12. Chrome doesn't show doc files, Firefox does.
cat office.html.erb
<%= render :layout => 'layouts/file' do %>

<script type="text/javascript"> function resizeObject(obj) { obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px'; } </script>

<%= preview_office_tag @attachment %>
<% end %>

modified to "<%= preview_office_tag @attachment, :size => 800%>"
but it didn't help.

any suggestions please?

@pr0l
Copy link
Author

pr0l commented Dec 6, 2019

@muradurm
Chrome 78.0.3904.108
Environment:
Redmine version 3.4.12.stable
Ruby version 2.4.9-p362 (2019-10-02) [x86_64-linux]
Rails version 4.2.11.1
Environment production
Database adapter Mysql2
Все работает.

@muradurm
Copy link

muradurm commented Dec 6, 2019

@pr0l
Redmine version 3.4.12.stable
Ruby version 2.6.5-p114 (2019-10-01) [x86_64-linux]
Rails version 4.2.11.1
Environment production
Database adapter Mysql2
Chrome Version 78.0.3904.108 (Official Build) (64-bit) - под Windows и под Linux пробовал - не показывает.

Еще недавно все работало.

@pr0l
Copy link
Author

pr0l commented Dec 6, 2019

@muradurm https://www.redmine.org/projects/redmine/wiki/RedmineInstall

3.4 | Ruby 1.9.31, 2.0.0, 2.1, 2.2, 2.3, 2.4 | Rails 4.2
а у тебя Ruby version 2.6.5-p114 (2019-10-01) [x86_64-linux]

@pr0l
Copy link
Author

pr0l commented Dec 6, 2019

@muradurm можно попробовать с фиксом https://github.com/enix223/redmine_preview_office

@muradurm
Copy link

muradurm commented Dec 6, 2019

@muradurm https://www.redmine.org/projects/redmine/wiki/RedmineInstall

3.4 | Ruby 1.9.31, 2.0.0, 2.1, 2.2, 2.3, 2.4 | Rails 4.2
а у тебя Ruby version 2.6.5-p114 (2019-10-01) [x86_64-linux]

под Firefox работает, так что вряд ли в этом дело.

@pr0l
Copy link
Author

pr0l commented Dec 6, 2019

@muradurm https://www.redmine.org/projects/redmine/wiki/RedmineInstall
3.4 | Ruby 1.9.31, 2.0.0, 2.1, 2.2, 2.3, 2.4 | Rails 4.2
а у тебя Ruby version 2.6.5-p114 (2019-10-01) [x86_64-linux]

под Firefox работает, так что вряд ли в этом дело.

у меня работает в моей конфигурации. Так что надо смотреть что у тебя выходит в коде страницы.
найди эту строку и посмотри
image

@muradurm
Copy link

muradurm commented Dec 6, 2019

redmine-pdf

@pr0l
Copy link
Author

pr0l commented Dec 6, 2019

@muradurm походу ты либо не закоментил скрипт. либо попробуй поменять в конфиге with <iframe>-tag на with <object><embed>-tag

@pr0l
Copy link
Author

pr0l commented Dec 6, 2019

это значит что скрипт вычисления работает если у тебя высота hight=0

@muradurm
Copy link

muradurm commented Dec 6, 2019

@muradurm походу ты либо не закоментил скрипт. либо попробуй поменять в конфиге with <iframe>-tag на with <object><embed>-tag

да, я не понял, что скрипт надо было удалить!
Удалил и заработало под Хромом.

Спасибо!

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

3 participants