To participate you must create an account on apostrophenow.org. If you have already done so, click Login.

Ticket #594 (closed defect: fixed)

Opened 21 months ago

Last modified 20 months ago

aButtonSlot - Edit View Form Markup is not good

Reported by: johnnyoffline Owned by: johnnyoffline
Priority: major Milestone: 1.5
Component: apostrophePlugin Version: trunk
Keywords: slots, 1.5rc, aButtonSlot Cc: johnnyoffline, rickybanister, jake, geoffd, dordille
Symfony version: 1.4

Description

Tom,

I don't really recognize what's going on in this partial to break it up and use the correct apostrophe sanctioned form markup.

It's outputting the form without enough markup in the right places, causing formatting to look bunk.

Can you explain this to me:

<?php
  // Compatible with sf_escaping_strategy: true
  $form = isset($form) ? $sf_data->getRaw('form') : null;
?>
<?php use_helper('I18N') ?>
<?php if ($form['url']->hasError()): ?>
  <div class="a-error"><?php echo __('Invalid URL. A valid example: http://www.punkave.com/', null, 'apostrophe') ?></div>
<?php endif ?>
<div class="a-form-row"><?php echo __('URL: %r%', array('%r%' => $form['url']->render()), 'apostrophe') ?></div>
<div class="a-form-row"><?php echo __('Title: %t%', array('%t%' => $form['title']->render()), 'apostrophe') ?></div>
<?php echo $form->renderHiddenFields() ?>

bad markup

looks bunk

Attachments

button1.PNG Download (9.4 KB) - added by anonymous 21 months ago.
button2.PNG Download (25.5 KB) - added by anonymous 21 months ago.

Change History

Changed 21 months ago by anonymous

Changed 21 months ago by tboutell

  • owner changed from tboutell to johnnyoffline
  • status changed from new to assigned

Huh, interesting. I don't think I wrote this but I may have.

It's just an i18n'd version of:

<div class="blah">URL: <?php echo $formurl?->render() ?></div>

I guess the idea was that by putting the entire row in the () call you get the ability to swap the order of the label and the input element when translating, but this is not important right now.

You can junk it entirely (well, after the prologue that grabs $form), and start over from echo $form and you won't be missing anything important. Make sure the bogus-URL error looks reasonable however you do it.

Changed 20 months ago by johnnyoffline

  • status changed from assigned to closed
  • resolution set to fixed

I fixed this and the edit forms for the rest of our slots.

[2216]

Note: See TracTickets for help on using tickets.