Migrations are logged to the watchdog, and we present a link to the log of migrations when complete. For reasons I don't recall, I created a custom view for this purpose - unless I can recall a good reason for this, we should instead link directly to the dblog view, filtered appropriately.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cilefen’s picture

Version: » 8.x-1.x-dev
Component: User interface » Code
Status: Active » Needs review
FileSize
7.81 KB
105.06 KB
138.84 KB

The message:

The log:

The reason you may not have done this is because you must play with the $_SESSION to filter dblog. So, if the user decides not to view the log, it will be filtered anyway the next time they view the dblog.

mikeryan’s picture

Yeah, I was afraid it would be something like that. I'm not entirely comfortable with mucking around with $_SESSION here, but it seems like the only way to do the filtering.

But, now I'm wondering if we should do the filtering at all... Looking at my test migration, I see some php notices along with the migrate_upgrade notices that I think should be visible, so maybe it's best to just link to the watchdog page as-is?

@cilefen: Are you on IRC? If so, maybe you could ping Bojahn and/or webchick in #drupal-contribute for their thoughts? If not, I'll do it tomorrow (end of my day here...).

Thanks!

cilefen’s picture

This works for me.

cilefen’s picture

@mikeryan I wouldn't worry about messing with $_SESSION. What I have done is exactly what the dblog module does when you filter log messages.

cilefen’s picture

We should make the link a form button so the admin affirmatively decides to filter the logs. In this patch, the logs will be filtered whether or not the link is followed.

cilefen’s picture

I feel a lot better about this solution. The logs become filtered in the session only if the link is clicked. I tried using a form button but that is not going to make sense in drupal_set_message() so I went with a new controller.

mrjmd’s picture

Status: Needs review » Reviewed & tested by the community

I tested this and it seems to be working as intended. Regarding the filtering issue, I agree this is much better than setting the filter when generating the message, as it will confuse people who don't click the link and later visit the logs.

  • mikeryan committed 8de3eac on 8.x-1.x authored by cilefen
    Issue #2282055 by cilefen: Remove the custom upgrade-log view
    
mikeryan’s picture

Status: Reviewed & tested by the community » Fixed

Committed with one tweak, making it "log" instead of "logs". Thanks!

Status: Fixed » Closed (fixed)

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