Jump to content

Autojoin broke processwire :P


adinuno
 Share

Recommended Posts

Hi there,

Today I was testing Autojoin and Global features on fields. I have a repeater field and I activated Global and Autojoin and processwire now shows the following message:

Unable to complete this request due to an error. Error has been logged.
 

The error log was this:

2013-10-31 01:36:08    ?    http://localhost/?/    Error:     Exception: Could not execute User::__construct() (in /Applications/XAMPP/xamppfiles/htdocs/cms/wire/core/Pages.php line 323)
 

How can I solve this problem? I have searched the site database, but I couldn't find this option the autojoin option to toggle it manually.

Thanks in advance :)

Link to comment
Share on other sites

The autojoin option is stored in the fields table as a flag. Most likely you'll see a '1' in the flag field for the relevant field. Change it to '0' and it will remove the autojoin. Keep in mind that I haven't tested autojoins with repeater fields - maybe autojoin and repeaters is not supported? Anyway, hopefully you can fix it with the DB change. 

  • Like 1
Link to comment
Share on other sites

The autojoin option is stored in the fields table as a flag. Most likely you'll see a '1' in the flag field for the relevant field. Change it to '0' and it will remove the autojoin. Keep in mind that I haven't tested autojoins with repeater fields - maybe autojoin and repeaters is not supported? Anyway, hopefully you can fix it with the DB change. 

I went in the fields table in my DB and the field in question had a number 5 in as the value of flags (not 1). What should I change this to? What does this mean?

Link to comment
Share on other sites

PW uses bitwise operators for setting flags. It does the same thing for the page status field (ie hidden, unpublished, trash etc). You can see the various values for each flag at the top of this file:

https://github.com/ryancramerdesign/ProcessWire/blob/a8024bb49785370aa2e3867bd683094663cfeabf/wire/core/Field.php

The values are added together and stored in the flags field, which is why you saw a 5 = autojoin (1) + global (4)

Hope that helps.

  • Like 3
Link to comment
Share on other sites

PW uses bitwise operators for setting flags. It does the same thing for the page status field (ie hidden, unpublished, trash etc). You can see the various values for each flag at the top of this file:

https://github.com/ryancramerdesign/ProcessWire/blob/a8024bb49785370aa2e3867bd683094663cfeabf/wire/core/Field.php

The values are added together and stored in the flags field, which is why you saw a 5 = autojoin (1) + global (4)

Hope that helps.

Oh yeah, it makes sense now. Thank you so much ;)

SOLVED!

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...