This resource is intended to help novice users, I believe it would be really useful and would not hurt the more experienced users, it is worth mentioning that the Drupal seeks in this phase to bring facilities to its community.

After install with messages:

Comments

thalles created an issue. See original summary.

thalles’s picture

Status: Needs work » Needs review
StatusFileSize
new949 bytes

Follow the patch!

thalles’s picture

Issue summary: View changes
StatusFileSize
new52.44 KB
megachriz’s picture

StatusFileSize
new56.19 KB

Hm, I'm not a fan of install messages. People can already find a link to the config page on the module list (see image). What would be a good idea though is explaining on the feed type listing page, that you first need to create a feed type and then a feed to import content.

thalles’s picture

Hi MegaChriz, I think these messages can help beginners, because when I installed my first modules I did not know where to configure them. I'm not an expert, so I always think that things in Drupal could be easier and more affordable. By chance, reading an article from Dries, he talks about being the time to make D8 a framework / cms easier for users and developers.

I think this is a strong point of Webform, as it always seeks to help, with messages and videos, I understand that messages can pollute the screen, but in some cases are very useful.

I believe these colleges are what make the tools stronger and more powerful.

About the feed type listing page, is it always good to help, as you might imagine, in the message or content format?

Note: I use a translation tool, so if something looks wrong or offensive, it may not be a very good translation.

megachriz’s picture

Status: Needs review » Needs work
StatusFileSize
new32.46 KB

Okay, I agree that it can be helpful for new users to know where to go next after enabling the Feeds module. And I agree that all the help texts provided by the Webform module can be a good help for new users.

I do think that the message "Thanks for installing Feeds" is not needed, because the message above already says that Feeds got enabled. The Webform module provides links to their online documentation:


That would probably a good idea to do here too. I think it should link to the following page:
https://www.drupal.org/docs/8/modules/feeds/creating-and-editing-import-...
Personally, I would omit the "Congratulations" message. To me that sounds like as if I just completed a hard task, while I only enabled a module.

A link to the feed type listing page like you already did in the patch from #2 could a be a good idea too to add to the install message. Maybe the message should be something like this "Start with adding a feed type".

As said in #3, I think the feed type listing page should mention that first you need to create a feed type and then - to actually import content - create a feed of that type.

The message for the feed type listing page should be implemented by implementing the hook hook_help(). For the install message, it would be nice if we can implement that in a similar as Webform does, if that is feasible (I mean: only do this if we don't need tons of code to achieve that).

thalles’s picture

When you say similar to webform, do you talk about the visual part?

megachriz’s picture

For Webform I meant both the visual and functional part.

Thinking about it again, maybe it's enough for Feeds to only display the message once, to keep it simple. The Webform install message stays on the module page until you click the cross.

thalles’s picture

The close button, I find it more difficult, but the small Info Messages module (https://www.drupal.org/project/info_messages) or we can create the css and add the icon

megachriz’s picture

Okay, forget about the Webform approach then. Just adjust the messages from the patch in #2 so that incorporates my other suggestions from #6.

thalles’s picture

Follow the patch!

thalles’s picture

Status: Needs work » Needs review
thalles’s picture

StatusFileSize
new953 bytes

Follow!

megachriz’s picture

Status: Needs review » Needs work

Thanks for the patch! Here is my review.

  1. +++ b/feeds.install
    @@ -12,6 +14,20 @@ function feeds_uninstall() {
    +  $messenger->addStatus(
    +    t('Module <em class="placeholder">Feeds</em> has been enabled.')
    +  );
    

    We don't need these lines. Drupal says by default which modules got enabled.

  2. +++ b/feeds.install
    @@ -12,6 +14,20 @@ function feeds_uninstall() {
    +  $messenger->addStatus(t('Start with adding a <a href="@url_settings">feed type</a> or access the <a target="feeds-guide" href="https://www.drupal.org/docs/8/modules/feeds/creating-and-editing-import-feeds">guide</a>.', [
    

    The link to the guide should be in a placeholder, just as you did for the other link (which placeholder is @url_settings).

    The reasons for why an url in a translatable string should always be a variable are the following:

    • Translators cannot mistype the url in the translation.
    • If the url would change in the future, the translatable string would stay the same, so it wouldn't need to be retranslated.
megachriz’s picture

Another remark: I think it's better to name the placeholder for add feed type link @feed_type_add_url instead of @url_settings, because that better describes the url that is going to be displayed.

thalles’s picture

Status: Needs work » Needs review
StatusFileSize
new1.31 KB

Follow the patch!

thalles’s picture

StatusFileSize
new896 bytes

Follow the correct patch!

darvanen’s picture

Status: Needs review » Needs work
+++ b/feeds.install
@@ -12,6 +14,18 @@ function feeds_uninstall() {
+  $messenger->addStatus(t('Start with adding a <a href="@feed_type_add_url">feed type</a> or access the <a target="feeds-guide" href="@guide_url">guide</a>.', [
+    '@feed_type_add_url' => Url::fromRoute('entity.feeds_feed_type.add_form')->toString(),
+    '@guide_url' => 'https://www.drupal.org/docs/8/modules/feeds/creating-and-editing-import-feeds',
+  ]));

Whilst I agree with @MegaChriz that we don't need to say congratulations or tell the user that the module has been installed, if the module is installed with a batch of others that generate messages, there is no way currently to know that this message is about Feeds.

Suggest full message text be (links abbreviated for readability here):

To configure feeds, start by adding a <a>feed type</a>. For more information <a>read the guide</a>.

srilakshmier’s picture

Status: Needs work » Needs review
StatusFileSize
new897 bytes
new827 bytes

Updating the patch based on #18. Please review.

Thank you

darvanen’s picture

Status: Needs review » Reviewed & tested by the community

Thanks @srilakshmier :)

Normally I would set this NW and tag it 'needs tests' but I don't know how this module likes that handled and I notice a maintainer has been in here and not mentioned it, so I'll leave it to the maintainers to decide if this needs a test.

RTBC

  • MegaChriz committed 9b7d56a on 8.x-3.x authored by thalles
    Issue #3022860 by thalles, srilakshmier, MegaChriz, darvanen: Show a...
megachriz’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for contributing. Committed #19 with one small change: for links I found out that the placeholder : (instead of @) is recommended in D8/D9.

See https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Component%21Rend...

As with @variable, do not use this within HTML attributes, JavaScript, or CSS. Doing so is a security risk.
:variable: Return value is escaped with \Drupal\Component\Utility\Html::escape() and filtered for dangerous protocols using UrlHelper::stripDangerousProtocols(). Use this when using the "href" attribute, ensuring the attribute value is always wrapped in quotes

@darvanen
Maybe not every little thing needs a test, so I committed it without one this time. Thanks for reviewing!

bohus ulrych’s picture

FYI when installed from command line:

composer require 'drupal/feeds:^3.0@alpha'
...
  - Downloading drupal/feeds (3.0.0-alpha11)
...

Everything looks ok.
But now I'm going to install this module:

drush -y en feeds

In RouteProvider.php line 206:

  Route "entity.feeds_feed_type.add_form" does not exist.

Same will happen again if I uninstall module (drush -y pmu feeds) and install it again.
Tested with Drupal version 9.2.10

Thanks

Status: Fixed » Closed (fixed)

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