The Views filter "Available on Current Domain" doesn't instanciate - you get a second or so of the animation and nothing happens. I had experienced so many issues with the previous version of Domain, that I rebuilt the site from scratch - all has been working great until this.

I'm hoping the issue can be easily reproduced.

The Domain filter is my prime means of sharing content (using the same view), so I'm marking this as major. It certainly is for me.

I don't know how my host (Imageleet) found this, but they detected the following error in the earlier installation. This looks like the same problem.

PHP Fatal error: Type of Drupal\domain_access\Plugin\views\filter\DomainAccessCurrentAllFilter::$value_value must be string (as in class Drupal\views\Plugin\views\filter\BooleanOperator) in /[site]/web/modules/contrib/domain/domain_access/src/Plugin/views/filter/DomainAccessCurrentAllFilter.php on line 17

Any suggestions greatly appreciated!

Issue fork domain-3367785

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

bcobin created an issue. See original summary.

agentrickard’s picture

Status: Active » Postponed (maintainer needs more info)

What version of PHP is this? What version of Drupal?

bcobin’s picture

Drupal 10.0.9 and PHP 8.1.20 - thanks fer' askin!

agentrickard’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new1.03 KB

This looks like strict type checking for two parameters that were added in Drupal 10.

bcobin’s picture

Sounds good to me - thanks for the response!

UPDATE: YAY!

Bingo. The filter instanciates, anyway - I'll be checking it going forward.

Thanks so much! Back to work... :)

bcobin’s picture

UPDATE: If you try invoking on all displays in a given view, it instanciates on only the targeted view and content fails to display. If you invoke on individual displays, though, it seems to work fine.

I'll take it. Thanks!

super_romeo’s picture

Status: Needs review » Reviewed & tested by the community

Patch #4 fixed the issue.

vzamko’s picture

Patch #4 works for me.

dqd’s picture

Confirm it as RTBC. Apart from that a notice of importance: in circumstances it can become a deal-beaker for updating Drupal from 9 to 10 since the database update required will trigger this issue and break the final db update. Applying the patch and re-trying to update database after core and modules update runs complete without flaws. 1+ for this issue fixed so quickly!

spuky’s picture

+1 for RTBC fixed problems with D10 upgrade

r81d3r’s picture

+1 RTBC

eskowe made their first commit to this issue’s fork.

ash2303 made their first commit to this issue’s fork.

ash2303’s picture

StatusFileSize
new1.08 KB

While patch #4 works fine, I think we don't need to re-declare properties again.
Updating patch, hope it works!

drupalfan2’s picture

I needed patch #15 in order to get it run after Drupal 10 Upgrade.
Patch #4 is also working.

agentrickard’s picture

Status: Reviewed & tested by the community » Needs work

The two patches need to be reconciled, since #15 is actually a different issue.

bwilliams1992’s picture

Tested on Drupal 10.1.6 after upgrade from Drupal 9.5.11 and patch #4 worked
Php version 8.1.18
10.3.27-MariaDB
nginx/1.17.10

ash2303’s picture

Both patches will work fine.
#4 was created before base class is updated
#15 is created after base class is updated

So as per latest base class change we need patch #15, we don't need to re-declare base class properties.
Refer: https://git.drupalcode.org/project/drupal/-/blob/10.1.x/core/modules/vie...

agentrickard’s picture

I'm looking for one clean patch.

agentrickard’s picture

Status: Needs work » Needs review

I see the problem.

https://git.drupalcode.org/project/drupal/-/blob/9.5.x/core/modules/view...
https://git.drupalcode.org/project/drupal/-/blob/10.0.x/core/modules/vie...

This was fixed in Drupal core, v 10.x (patch 15). If we commit that, we may break BC with Drupal 9.5, which does not have that (patch 4).

I think the best option is to commit #15. But that might throw some warnings on PHP 8.2 / Drupal 9.5. Not sure we can do anything about that.

ankondrat4 made their first commit to this issue’s fork.

ankondrat4’s picture

Status: Needs review » Reviewed & tested by the community

Hello.
+1 RTBC for patch #14 and MR !56 on Drupal 10.

dqd’s picture

Version: 2.0.0-beta1 » 2.0.x-dev
Component: - Domain Content » Code
Status: Reviewed & tested by the community » Needs review

Thanks for all the work in here. But - Please do not review your own work. First of all patches and merges should be made against latest dev. Second, there are no further comments if anything of #20 & #21 has been addressed yet. Also I would like to read opinions if the attempts here overlap somehow with: #3413610: Fatal error: Type $value_value must be string DomainAccessCurrentAllFilter.php on line 0

capysara’s picture

Status: Needs review » Reviewed & tested by the community

I'll try to summarize the current status.

I'm hiding the patches to avoid confusion going forward.

The current MR just applies the patch from #15 and moves it into a MR. That should address #20 "one clean patch." I'm assuming that the comment meant one clean patch/MR, but if it literally meant "patch," then my apologies for muddying the issue.

RE: #21 I agree with this. It might throw warnings (on EOL D9), but it shouldn't break things.

I think the best option is to commit #15. But that might throw some warnings on PHP 8.2 / Drupal 9.5. Not sure we can do anything about that.

RE: #24, you're right, this issue definitely overlaps with 3413610. It's the same problem, and they addressed it in the same way as #4 in this issue.

I'm closing the other as a duplicate.

I've successfully used the MR so I'm setting to RTBC.

spuky’s picture

added a fix for an error in the same file during a D 10.3 update but there is also the same fix in 3456123

should I revert my commit ?

spuky’s picture

reverted my commit to keep thing sepperate

agentrickard’s picture

Status: Reviewed & tested by the community » Needs work

This needs a refactor against 2.0.x

webflo made their first commit to this issue’s fork.

webflo’s picture

Status: Needs work » Needs review
davps’s picture

StatusFileSize
new66.2 KB
new81.16 KB

This was fixed in Drupal core, v 10.x (patch 15). If we commit that, we may break BC with Drupal 9.5, which does not have that (patch 4).

I think the best option is to commit #15. But that might throw some warnings on PHP 8.2 / Drupal 9.5. Not sure we can do anything about that.

In this case (#21), the best solution is to use a separate main tag to ensure backward compatibility.

The main problem is the changed scope of the options method. If we remove the override of this method in the filter, we can forget about the backward compatibility issue.

The interface difference is small and may be worth ignoring to forget about the backward compatibility issue at this point:

  • with overridewith override
  • without overridewithout override

However, MR 85 looks good to me

davps’s picture

StatusFileSize
new79.64 KB
webflo’s picture

The problem with the operator selection is that the query does not support the "!=" option. Therefore, "=" must always be selected.

agentrickard’s picture

Now I wonder if this causes any changes to configuration of existing views.

Testing. {update: it does not]

agentrickard’s picture

MR 85 threw an error on 10.3.

Object { message: "\nAn AJAX HTTP error occurred.\nHTTP Result Code: 200\nDebugging information follows.\nPath: /admin/structure/views/ajax/add-handler/duplicate_of_content/page_1/filter\nStatusText: parsererror\nResponseText: \nFatal error:  Access level to Drupal\\domain_access\\Plugin\\views\\filter\\DomainAccessCurrentAllFilter::operators() must be public (as in class Drupal\\views\\Plugin\\views\\filter\\BooleanOperator) in /var/www/html/web/modules/contrib/domain/domain_access/src/Plugin/views/filter/DomainAccessCurrentAllFilter.php on line 22", name: "AjaxError", stack: "@https://example.local/sites/default/files/js/js_CvjJwztkp7NtVTxtZWNJm8stD9baau_A9bcQr6PPVOw.js?

Investigating.

agentrickard’s picture

Status: Needs review » Reviewed & tested by the community

I have updated MR 85 to use a public method for function operators().

This should be RTBC; Drupal 9 support was dropped last year.

https://www.drupal.org/docs/understanding-drupal/drupal-9-release-date-a...

  • agentrickard committed b047251b on 2.0.x authored by webflo
    Issue #3367785 by webflo, spuky, agentrickard, ash2303, ankondrat4,...
agentrickard’s picture

Status: Reviewed & tested by the community » Fixed

Merged

Status: Fixed » Closed (fixed)

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

nicolas-lsn’s picture

Patch for the current 2.0.0-beta1, awaiting the next release.