Template editor issues

Hi Nick,

Sorry, it has been fixed already [1], and a very stupid bug indeed, you
have two options

  1. make sure you click on preview first, then submit
  2. apply this simple diff:

diff --git a/public/javascripts/config_template.js
b/public/javascripts/config_template.js
index a43b66b…d2e24ea 100644
— a/public/javascripts/config_template.js
+++ b/public/javascripts/config_template.js
@@ -15,7 +15,7 @@ $(function() {
set_edit_mode(template_text);
}
$('#config_template_submit').on('click', function(){

  •   set_edit_mode( $(".template_text"));
    
  •  if($('.diffMode').size() >0){ set_edit_mode( $(".template_text")); }
    
    })
    }

for the record, there is also a 1.0-stable branch on git, which has all of
the bug fixes that have been found since releasing 1.0

afaik, new packing for 1.0 should apply the patches (at least this one), so
if you are using a package, it should hopefully resolve soon.

Ohad

[1] Bug #1778: Provisioning Templates editor does not save - Foreman

··· On Wed, Aug 1, 2012 at 6:44 AM, Nick Wales wrote:

I just upgraded foreman from 0.42 to 1.0 on CentOS 6.3. Since then I have
been trying to update and create some provisioning templates, but not being
very successful.

I can’t edit any templates, any changes I make are visibly removed from
the graphical editor once I press Submit, any changes are not in the
production.log file (I see the unedited content again) and certainly not in
the database.

I can edit, using the same mysql login directly on the DB so we have write
access and those changes are immediately available on the web UI.

I’m making these edits on a mac, have tried safari, firefox and chrome,
all to the same effect…

Any ideas?

You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/foreman-users/-/OjBf61t9Ur0J.
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to
foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/foreman-users?hl=en.

>
> Hi Nick,
>
> Sorry, it has been fixed already [1], and a very stupid bug indeed, you have two options
> 1. make sure you click on preview first, then submit
> 2. apply this simple diff:
>
> diff --git a/public/javascripts/config_template.js b/public/javascripts/config_template.js
> index a43b66b…d2e24ea 100644
> — a/public/javascripts/config_template.js
> +++ b/public/javascripts/config_template.js
> @@ -15,7 +15,7 @@ $(function() {
> set_edit_mode(template_text);
> }
> $('#config_template_submit').on('click', function(){
> - set_edit_mode( $(".template_text"));
> + if($('.diffMode').size() >0){ set_edit_mode( $(".template_text")); }
> })
> }
>
> for the record, there is also a 1.0-stable branch on git, which has all of the bug fixes that have been found since releasing 1.0
>
> afaik, new packing for 1.0 should apply the patches (at least this one), so if you are using a package, it should hopefully resolve soon.
>
> Ohad
>
>

Thanks for the quick response Ohad, the preview trick works… will give the patch a go shortly.

··· > [1] http://theforeman.org/issues/1778 > > > > > -- > You received this message because you are subscribed to the Google Groups "Foreman users" group. > To post to this group, send email to foreman-users@googlegroups.com. > To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/foreman-users?hl=en.