Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Alan Evans’s picture

Issue summary: View changes

The previous patch no longer works on current D8. Adding a revised patch shortly.

Alan Evans’s picture

Issue tags: +#lsdhack
FileSize
16.44 KB

Work on this Drupal 8 upgrade patch was done by Marcelo Vani, Arled, and myself as part of the Acquia Large Scale Drupal hackathon event London 26th-27th February 2014.

The changes made here include:

  • Conversion of the configuration storage to D8 CMI
  • Conversion of the content callback and administration page to D8 routing and controllers
  • Addition of tests for general functionality
  • Use of appropriate D8 response object for the text/plain robots.txt file
  • Removal of unused D7 hooks
  • Conversion to D8 conventions where needed (eg using t() in install functions instead of $t = get_t())
  • Implementation of hook_menu_link_defaults for adding an admin link to the admin page
  • Included latest D8 robots.txt file as a default fallback
Alan Evans’s picture

Updated - coding standards and test fix.

Alan Evans’s picture

Posting interdiff for comparison between the original D7-D8 upgrade patch on this issue and patch on comment #3.

Alan Evans’s picture

FileSize
18.29 KB
marcelovani’s picture

Priority: Normal » Major
hass’s picture

Priority: Major » Normal
hass’s picture

Status: Needs review » Needs work

Don't set weight on menu item, please.
Never make line breaks inside t().

marcelovani’s picture

Status: Needs work » Needs review
FileSize
18.88 KB

I have committed the changes here http://drupalcode.org/sandbox/alanevans/2205569.git/shortlog/refs/heads/...

and the patch is attached.

marcelovani’s picture

FileSize
19.23 KB

Err, uploaded the wrong file...

hass’s picture

Status: Needs review » Needs work
  1. +++ b/robotstxt.module
    @@ -4,18 +4,31 @@
    -      return '<p>' . t('In a multisite environment, there is no mechanism for having a separate robots.txt file for each site. This module addresses that need by letting you administer the robots.txt file from the settings interface.') . '</p>';
    +      $output .= '<h3>' . t('About') . '</h3>';
    +      $output .= '<p>' . t('In a multisite environment, there is no mechanism for having a separate robots.txt file for each site.') . '</p>';
    ...
    +      $output .= '<p>' . t('You can configure your Robots.txt !link.',
    +        array('!link' => l(t('here'), 'admin/config/search/robotstxt'))
    +      ) . '</p>';
           break;
    ...
    +          array('!link' => l(t('Status report'), 'admin/reports/status'))), 'warning'
    

    never use l() inside t() and never use the word "here".

    Roll back to single line. Do not change anything.

  2. +++ b/robotstxt.module
    @@ -4,18 +4,31 @@
    +          array('!link' => l(t('Status report'), 'admin/reports/status'))), 'warning'
    +        );
    ...
    +        array(
    

    Bug

  3. +++ b/robotstxt.module
    @@ -4,18 +4,31 @@
    -      return t('See <a href="http://www.robotstxt.org/">http://www.robotstxt.org/</a> for more information concerning how to write your <a href="@robotstxt">robots.txt</a> file.', array('@robotstxt' => base_path() . 'robots.txt'));
    +      $output = t('See !link1 for more information concerning how to write your !link2 file.',
    +        array(
    +          '!link1' => l(t('http://www.robotstxt.org'), 'http://www.robotstxt.org', array('attributes' => array('target'=>'_blank'))),
    +          '!link2' => l(t('robots.txt'), 'robots.txt'),
    +        )
    +      );
           break;
       }
    

    Bug

If you changed any logic compared to D7 or introduced any new features roll them back, too. I have not fully reviewed the code... so just as a warning.

marcelovani’s picture

Status: Needs work » Needs review
FileSize
18.68 KB
hass’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev
Issue tags: -#lsdhack

Created a branch for D8

hass’s picture

New patch attached.

hass’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.