[Git][noosfero/noosfero][master] 3 commits: Fixes article custom fields update

Rodrigo Souto gitlab at mg.gitlab.com
Fri Oct 19 17:07:43 BRT 2018


Rodrigo Souto pushed to branch master at Noosfero / noosfero


Commits:
163cf379 by MatheusRich at 2018-10-17T15:17:51Z
Fixes article custom fields update

- - - - -
17d7174c by MatheusRich at 2018-10-19T13:13:02Z
Fixes custom fields partial

- - - - -
5b06b2c5 by Rodrigo Souto at 2018-10-19T20:07:41Z
Merge branch 'fix-article-custom-fields' into 'master'

Fixes article custom fields update

See merge request noosfero/noosfero!1628
- - - - -


2 changed files:

- app/controllers/my_profile/cms_controller.rb
- app/views/cms/_article_custom_fields.html.erb


Changes:

=====================================
app/controllers/my_profile/cms_controller.rb
=====================================
@@ -92,7 +92,7 @@ class CmsController < MyProfileController
       params_metadata = params[:article].try(:delete, :metadata) || {}
       custom_fields = params_metadata.try(:delete, :custom_fields) || {}
       @article.metadata = @article.metadata.merge(params_metadata)
-      @article.metadata[:custom_fields] = custom_fields
+      @article.metadata["custom_fields"] = custom_fields
       @article.last_changed_by = user
       @article.update_access_level(params[:article][:access])
       params[:article].delete(:access)


=====================================
app/views/cms/_article_custom_fields.html.erb
=====================================
@@ -2,8 +2,8 @@
   <h4 class='box-title'><%= _('Additional Fields') %></h4>
 
   <div id='article-custom-fields'>
-    <% fields.each do |key, field| %>
-      <% field.symbolize_keys! %>
+    <% fields.each do |key, value| %>
+      <% field = value.symbolize_keys %>
       <%= render partial: "cms/custom_fields/#{field[:type]}", locals: { field: field } %>
     <% end %>
   </div>



View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/1eafadab3591c8c0df8c89978f637b98a9dae41b...5b06b2c52c5a574b31650f4452bec5a3d0688e84

-- 
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/1eafadab3591c8c0df8c89978f637b98a9dae41b...5b06b2c52c5a574b31650f4452bec5a3d0688e84
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20181019/e2fc77de/attachment-0001.html>


More information about the Noosfero-dev mailing list