Details

    • Database:
      Any
    • Testing Instructions:
      Hide
      1. Go to a course and create a database activity
      2. Add fields of this types: checkbox, menu, multimenu, radiobutton. In the add form, the size of the textarea SHOULD be the one specified in the class 'optionstextarea' (you can check it with a code inspector - applied styles)
      3. Add one 'textarea' field; In the add form, the size of the width and height elements should be the specified in the class 'textareafieldsize'
      4. Add one 'picture' field; In the add form, the size of the size elements should be the specified in the class 'picturefieldsize'
      5. Add a 'number' and a 'text' field
      6. Add a 'latlong' field selecting one of the multiselect elements
      7. Go to 'Add entry', the input element of the number and text fields SHOULD NOT have inline styles and the 'basefieldinput' class styles SHOULD be applied
      8. Fill the 'Add entry' form and go to 'view list' or 'view single', the latlong field values SHOULD respect the default template style (it SHOULD be displayed like any other field, not centered)
      9. Go to the 'View list' tab
      10. In the lower part of the page you SHOULD see the basic search fields: entries per page, search, sort by
      11. In the same basic select search fields, if you check 'advanced search' the 'search' text input SHOULD be hidden and there SHOULD appear a lot of fields below (a lot = one for each database field + author fields)
      12. Go to the 'search' tab the 'search' text input SHOULD be hidden and there SHOULD appear a lot of fields (a lot = one for each database field + author fields)
      13. Go to the 'templates' tab and navigate through the different templates
      14. The heading SHOULD be centered
      15. Try to edit the templates and check the corresponding associated pages, the template styles SHOULD be respected
      Show
      Go to a course and create a database activity Add fields of this types: checkbox, menu, multimenu, radiobutton. In the add form, the size of the textarea SHOULD be the one specified in the class 'optionstextarea' (you can check it with a code inspector - applied styles) Add one 'textarea' field; In the add form, the size of the width and height elements should be the specified in the class 'textareafieldsize' Add one 'picture' field; In the add form, the size of the size elements should be the specified in the class 'picturefieldsize' Add a 'number' and a 'text' field Add a 'latlong' field selecting one of the multiselect elements Go to 'Add entry', the input element of the number and text fields SHOULD NOT have inline styles and the 'basefieldinput' class styles SHOULD be applied Fill the 'Add entry' form and go to 'view list' or 'view single', the latlong field values SHOULD respect the default template style (it SHOULD be displayed like any other field, not centered) Go to the 'View list' tab In the lower part of the page you SHOULD see the basic search fields: entries per page, search, sort by In the same basic select search fields, if you check 'advanced search' the 'search' text input SHOULD be hidden and there SHOULD appear a lot of fields below (a lot = one for each database field + author fields) Go to the 'search' tab the 'search' text input SHOULD be hidden and there SHOULD appear a lot of fields (a lot = one for each database field + author fields) Go to the 'templates' tab and navigate through the different templates The heading SHOULD be centered Try to edit the templates and check the corresponding associated pages, the template styles SHOULD be respected
    • Workaround:
      Hide

      For this we should modify /mod/data/lib.php arround de line 246:

      OLD:
      $str .= '<input style="width:300px;" type="text" name="field_'.$this->field->id.'" id="field_'.$this->field->id.'" value="'.s($content).'" />';

      New:
      $str .= '<input type="text" name="field_'.$this->field->id.'" id="field_'.$this->field->id.'" value="'.s($content).'" />';

      Show
      For this we should modify /mod/data/lib.php arround de line 246: OLD: $str .= '<input style="width:300px;" type="text" name="field_'.$this->field->id.'" id="field_'.$this->field->id.'" value="'.s($content).'" />'; New: $str .= '<input type="text" name="field_'.$this->field->id.'" id="field_'.$this->field->id.'" value="'.s($content).'" />';
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-31496_master
    • Rank:
      38034

      Description

      The problem is that certain database activity module fields are printed with inline CSS(width=300px. That doesn't let us modify the style of that fields.
      The fields with that behaviour are those that haven't got redefined the display_add_field method (For example: number field class /mod/data/field/number/field.class.php). So the best option would be to modify the method of the parent class (data_field_base) and then if its necesary each field should have its own display_add_field redefined.

        Activity

        Hide
        Michael de Raadt added a comment -

        Thanks for suggesting that change and putting forward a patch.

        Show
        Michael de Raadt added a comment - Thanks for suggesting that change and putting forward a patch.
        Hide
        Aparup Banerjee added a comment -

        as spoken with David, the css should be within mod/data/styles.css where the preset can be modified for the field's instance by the user.

        Show
        Aparup Banerjee added a comment - as spoken with David, the css should be within mod/data/styles.css where the preset can be modified for the field's instance by the user.
        Hide
        David Monllaó added a comment -

        I've split the commits to be easily readable. It maintains all the template styles overwrites, in the latlong field the form is only displayed when is necessary to allow users to re-style it when possible.

        Show
        David Monllaó added a comment - I've split the commits to be easily readable. It maintains all the template styles overwrites, in the latlong field the form is only displayed when is necessary to allow users to re-style it when possible.
        Hide
        David Monllaó added a comment -

        I didn't add the label 'ui_change' because the styles are the same, I've just moved them to the styles files (Not sure if I have to add it in this cases) Adding testing instructions to verify that the there are no issues related with the CSS priority changes (from inline to CSS classes)

        Show
        David Monllaó added a comment - I didn't add the label 'ui_change' because the styles are the same, I've just moved them to the styles files (Not sure if I have to add it in this cases) Adding testing instructions to verify that the there are no issues related with the CSS priority changes (from inline to CSS classes)
        Hide
        Andrew Davis added a comment -

        Thats a lot of hard coded style. Are the class names correct? just looking through some css files it looks like multi-word class names usually use hyphens instead of underscores (_). Otherwise it looks fine.

        Show
        Andrew Davis added a comment - Thats a lot of hard coded style. Are the class names correct? just looking through some css files it looks like multi-word class names usually use hyphens instead of underscores (_). Otherwise it looks fine.
        Hide
        David Monllaó added a comment -

        Thanks Andrew, I also thought that "-" is more used to split words, but I followed http://docs.moodle.org/dev/CSS_coding_style#Selectors; not 100% sure it's a valid docs page, so if I'm wrong please tell me, otherwise I'll submit for integration if it's ok for you

        Show
        David Monllaó added a comment - Thanks Andrew, I also thought that "-" is more used to split words, but I followed http://docs.moodle.org/dev/CSS_coding_style#Selectors ; not 100% sure it's a valid docs page, so if I'm wrong please tell me, otherwise I'll submit for integration if it's ok for you
        Hide
        Andrew Davis added a comment -

        I think that docs page is valid. In that case you are correct and everything else is wrong Submit for integration whenever you're ready.

        Show
        Andrew Davis added a comment - I think that docs page is valid. In that case you are correct and everything else is wrong Submit for integration whenever you're ready.
        Hide
        Eloy Lafuente (stronk7) added a comment -

        The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

        TIA and ciao

        Show
        Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
        Hide
        Sam Hemelryk added a comment -

        Thanks David, changes look good and this has been integrated now.

        Show
        Sam Hemelryk added a comment - Thanks David, changes look good and this has been integrated now.
        Hide
        Ankit Agarwal added a comment -

        Works as expected.
        Thanks

        Show
        Ankit Agarwal added a comment - Works as expected. Thanks
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Many thanks for the hard work.

        These changes have been spread upstream and are already available in the git and cvs repositories.

        Ciao

        Show
        Eloy Lafuente (stronk7) added a comment - Many thanks for the hard work. These changes have been spread upstream and are already available in the git and cvs repositories. Ciao

          People

          • Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: