Closed (fixed)
Project:
Site Status Message
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
14 Oct 2015 at 09:24 UTC
Updated:
28 Sep 2017 at 10:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
drupalgideonComment #3
drupalgideonComment #4
shkiper commentedI made this module compatible with Drupal 8. Could someone check my patch?
Comment #5
drupalgideonThanks for this. I really appreciate the work you've put in.
I did get a "The website encountered an unexpected error. Please try again later." message unfortunately when I put as the Read More page. And paths require the "/" too or this error occurs as well.
Also I was planning on incorporating the changes in the 7.x-dev branch which moves the configuration to a new page. I'm assuming that the Variables for multilingual support are handled in Drupal 8 Core.
Comment #6
shkiper commentedHi @SkidNCrashwell. What data did you tried to put in the link settings? As I understood Drupal 8 accepts internal links only if they start from '/'. I guess I need to add validation for this.
Comment #7
drupalgideonYes I tried
<front>and "node/1" rather than "/node/1" (I was testing to break!)I reckon something like
in the validator should help.
Comment #8
shkiper commentedHi @SkidNCrashwell. I've added additional validation for link. Could you please check my new patch?
Comment #9
drupalgideonGreat stuff! Thank you.
However, I had a few issues on my brief testing.
I entered
/node/1for the URL and got an error sayingI changed one line to only look at the first character of the raw link for the
in_arraycheck as follows -if (parse_url($link, PHP_URL_SCHEME) === 'internal' && !in_array($raw_link[0], ['/', '?', '#'], TRUE) && substr($raw_link, 0, 7) !== '<front>') {This passed the first test but then I got an invalid internal path error.
I then made another change to check the raw link which worked.
One final change is I put the error message symbols in
<em>tags so that the comma isn't seen as an allowed symbol too!$form_state->setErrorByName('site_status_message_link', t('Manually entered paths should start with %slash, %question or %hash.', ['%slash' => '/', '%question' => '?', '%hash' => '#']));I've not made a patch of this, however, but can. Unless you want to check yourself?
Then I'll roll out a release hopefully this weekend. The next step would be to get the form on a separate page as per the 7.x-dev branch, but there's no rush for that.
Comment #10
drupalgideonOh, I've just noticed that the error says you must enter a valid internal path. However, you can add external URLs...!
Comment #11
shkiper commentedHi @SkidNCrashwell. Thank you for your review. Existing validation logic for internal links I took from Drupal core. I changed texts for errors messages. Could you please check new patch?
Comment #12
drupalgideonI have had to make a few changes and included translation.
One thing I noticed was the config wasn't being picked up on install and also it was causing an issue when I uninstalled so I fixed that too
I've attached a patch based off yours. If you could apply this and test (as well as anyone else!) and let me know how you get on.
Thanks
Comment #14
drupalgideonChanges are in DEV branch now. Please test and report back and I will get a stable release out.
Comment #15
drupalgideonComment #16
drupalgideonComment #17
drupalgideonClosing this issue. The latest 8.x version of this module appears to work with D8.
Tests still to write (copies of the 7 version tests) before a stable release is created, however.