All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Wood <michael.g.wood@intel.com>
To: toaster@yoctoproject.org
Subject: Re: [PATCH] toaster: correctly handle quotes in project names
Date: Thu, 10 Mar 2016 11:24:43 +0000	[thread overview]
Message-ID: <56E1597B.5030209@intel.com> (raw)
In-Reply-To: <1457535135-5725-1-git-send-email-elliot.smith@intel.com>

I think this is fixed here already so much be better to just wait for 
the build cancel stuff to be merged?

http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/diff/bitbake/lib/toaster/toastergui/static/js/mrbsection.js?h=michaelw/sujith/build-cancel&id=1dfe119322cc7ab35e489bc83f9bcc49b087b0c4

Michael

On 09/03/16 14:52, Elliot Smith wrote:
> A project name like "Elliot's project" causes the "Rebuild" buttons
> in the most recent builds section to fail when clicked with:
>
> Uncaught SyntaxError: Unexpected token ILLEGAL
>
> This is because the single quote character causes the JavaScript
> for handling the button click event to be badly-formed.
>
> As the project name is passed to the scheduleBuild() function
> but doesn't actually do anything, this can be fixed by removing
> the project name from the arguments passed to scheduleBuild()
> (as well as the project URL, which is also ignored).
>
> Signed-off-by: Elliot Smith <elliot.smith@intel.com>
> ---
>   bitbake/lib/toaster/toastergui/templates/mrb_section.html | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/bitbake/lib/toaster/toastergui/templates/mrb_section.html b/bitbake/lib/toaster/toastergui/templates/mrb_section.html
> index 551e341..f43390f 100644
> --- a/bitbake/lib/toaster/toastergui/templates/mrb_section.html
> +++ b/bitbake/lib/toaster/toastergui/templates/mrb_section.html
> @@ -109,10 +109,7 @@
>                         {%endif%}
>                         pull-right"
>                         onclick='scheduleBuild({% url 'projectbuilds' build.project.id as bpi %}{{bpi|json}},
> -                        {{build.project.name|json}},
> -                        {% url 'project' build.project.id as purl %}{{purl|json}},
>                           {{build.target_set.all|get_tasks|json}})'>
> -
>                           Rebuild
>                     </button>
>                 {% endif %}
> @@ -134,7 +131,7 @@
>   
>   <script>
>   
> -function scheduleBuild(url, projectName, projectUrl, buildlist) {
> +function scheduleBuild(url, buildlist) {
>     console.log("scheduleBuild");
>     libtoaster.startABuild(url, null, buildlist.join(" "), function(){
>       console.log("reloading page");



  reply	other threads:[~2016-03-10 11:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-09 14:52 [PATCH] toaster: correctly handle quotes in project names Elliot Smith
2016-03-10 11:24 ` Michael Wood [this message]
2016-03-10 11:35   ` Smith, Elliot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56E1597B.5030209@intel.com \
    --to=michael.g.wood@intel.com \
    --cc=toaster@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.