Account created on 24 March 2008, over 16 years ago
#

Recent comments

🇺🇸United States wxman

@pauleb Thank you that works perfectly with no errors

🇺🇸United States wxman

All my sites started doing the same thing as well. I got rid of it by adding

export COMPOSER_ROOT_VERSION=dev-main

to all the sites .bashrc file.

🇺🇸United States wxman

@joachim I'm not questioning your advice at all. You are much better at working on this that I will ever be. I was just confused as to which value needs to be changed. I thought if the value comes up empty the view just doesn't show it.

🇺🇸United States wxman

@joachim Okay this is working as shown, so which are you saying needs to be changed?

🇺🇸United States wxman

You were correct about the mistake. Leftovers from other try's. If you want to see something scary, I asked Bing's Copilot: "how can I improve this PHP code". I pasted my original plugin code into it, and not only did it fix/improve it, it recognized that it was for linking to Amazon Associates. It came back with this:

class Computedbuyamazon extends ComputedFieldBase {

    /**
     * {@inheritdoc}
     */
    public function computeValue(EntityInterface $host_entity, ComputedFieldDefinitionWithValuePluginInterface $computed_field_definition): array {
        $ISBN = $this->getISBN($host_entity);

        if (!empty($ISBN)) {
            $value = $this->generateAmazonLink($ISBN);
        } else {
            $value = '';
        }

        return [
            0 => [
                'value' => $value,
                'format' => 'full_html',
            ],
        ];
    }

    /**
     * Get the ISBN from either field_isbn10 or field_amazon_asin.
     *
     * @param EntityInterface $host_entity
     * @return string|null
     */
    private function getISBN(EntityInterface $host_entity): ?string {
        if (!empty($host_entity->field_isbn10->value)) {
            return $host_entity->field_isbn10->value;
        } elseif (!empty($host_entity->field_amazon_asin->value)) {
            return $host_entity->field_amazon_asin->value;
        }
        return null;
    }

    /**
     * Generate the Amazon link and image HTML.
     *
     * @param string $ISBN
     * @return string
     */
    private function generateAmazonLink(string $ISBN): string {
        $link = '<a href="https://www.amazon.com/gp/product/' . $ISBN . '/ref=as_li_tf_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=' . $ISBN . '&linkCode=as2&tag=thelittim04-20" target="_blank">Amazon.com</a>';
        $image = '<img src="https://www.assoc-amazon.com/e/ir?t=thelittim04-20&l=as2&o=1&a=' . $ISBN . '" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />';

        return $link . $image;
    }
}

It works perfectly. The AI even gave me pointers and explained why it suggested what it did. Scary!

🇺🇸United States wxman

@mts11 I tried the patch at https://www.drupal.org/project/computed_field/issues/3410696#comment-153... 💬 Deprecated function Creation of dynamic property error in php 8.2 Needs review and it works perfectly using php 8.2

🇺🇸United States wxman

@sidharth_soman I applied the patch using PHP 8.2.13 and no errors. Thank you.

🇺🇸United States wxman

@sidharth_soman Sorry I can't get to my system right away but I'll try it as soon as I can

🇺🇸United States wxman

I found DB entries:

1 match in cache_config 	Browse 	Delete 		
2 matches in cache_data 	Browse 	Delete		
1 match in config 	Browse 	Delete
1 match in config_export 	Browse 	Delete
1 match in config_import 	Browse 	Delete
1 match in config_snapshot 	Browse 	Delete 

A search of the site found:

views.view.user_pages.yml:          default_argument_type: profile_owner
views.view.user_pages.yml:          default_argument_type: profile_owner
views.view.user_pages.yml:          default_argument_type: profile_owner

I think I fixed it. I manually deleted the DB entries that were showing, and removed the file in the /web/sites/default/files/config directory. I reran the updates, and the database updated normally. My manual cron still seems to be not working, but I'll put up with that for now. I still don't know how those entries could have been left over after all this time.

🇺🇸United States wxman

I think I fixed it. I manually deleted the DB entries that were showing, and removed the file in the /web/sites/default/files/config directory. I reran the updates, and the database updated normally. My manual cron still seems to be not working, but I'll put up with that for now. I still don't know how those entries could have been left over after all this time.

🇺🇸United States wxman

@cilefen I found them, in a round about way. Made a 777 folder on the server and extracted them there. Ran the grep again and found these

views.view.user_pages.yml:          default_argument_type: profile_owner
views.view.user_pages.yml:          default_argument_type: profile_owner
views.view.user_pages.yml:          default_argument_type: profile_owner
🇺🇸United States wxman

@cilefen well I just discovered that Windows 11 has a flaw. you can't search for text within files. So I guess for now I can't answer.

🇺🇸United States wxman

@cilefen I did a db search and found "profile_owner" in these:

1 match in cache_config 	Browse 	Delete 		
2 matches in cache_data 	Browse 	Delete		
1 match in config 	Browse 	Delete
1 match in config_export 	Browse 	Delete
1 match in config_import 	Browse 	Delete
1 match in config_snapshot 	Browse 	Delete 
🇺🇸United States wxman

No I completely uninstalled it the correct way. I just posted over in the Profile module issues to see if someone there recognizes it. It's really baffling me. I'm also going to try to run updates on a site I never used Profile in to see what happens. After I back everything up first.

🇺🇸United States wxman

@cilefen I installed it, tried it for a short time, then realized it wasn't going to do what I needed. I uninstalled it using Composer like I always do. This was long before I upgraded to D10, so why would it only now be showing up? Is there a way I don't know of to check to see if the Profile Module has some "ghosts" hanging around? I can't seem to do any updates now because it won't let me get past this issue. My cron even keeps stopping.

🇺🇸United States wxman

@cilefen I had the Profile Module installed once, but I removed it a long time ago. Actually long before Drupal 10 even came out. If that's what it's looking for, why now?

🇺🇸United States wxman

@mts11 I just switched to php 8.2.x and now it's all over the place:

Deprecated function: Creation of dynamic property Drupal\computed_field\Field\FieldStorageDefinition::$schema is deprecated in Drupal\computed_field\Field\FieldStorageDefinition->getSchema() (line 299 of modules/contrib/computed_field/src/Field/FieldStorageDefinition.php).
🇺🇸United States wxman

It always helps me when I can see the sequence rather that someone just telling me to "upgrade this...". Glad we could help.

🇺🇸United States wxman

@mts11 I gave up trying to put them in a single plug-in and opted to make separate ones.

@joachim If I remove that it's going to allow it to pass empty if nothing is entered?

🇺🇸United States wxman

@mts11 Did you add the patch to composer.json

"patches": {
    "drupal/core": {
        "computed base fields to work in Views": "https://git.drupalcode.org/project/drupal/-/merge_requests/4224.diff"
     }
},

Also, did you make a *.views.inc file as well?

One of mine generates a simple URL link to an online bookstore. The Computed Field is called 'computed_buy_booksamillion'. It takes the ISBN number entered in another text field, and inserts it into the URL. The plug-in I made I called 'buy_booksamillion'. Along with the *.yml file I added 'buy_booksamillion.views.inc':

/**
 * @file
 * Allows the computed field Buy Booksamillion(computed_buy_booksamillion) to be used in views.
 * Works with Computed Field ver 4.x
 */

/**
 * Implements hook_views_data().
 */
function buy_booksamillion_views_data() {

  $data['node_field_data']['computed_buy_booksamillion'] = [
    'title' => t('Buy Booksamillion'),
    'entity field' => 'computed_buy_booksamillion',
    'field' => [
      'id' => 'field',
    ],
  ];

  return $data;
}

Then under buy_booksamillion/src/Plugin/ComputedField/Computedbuybooksamillion.php:

namespace Drupal\buy_booksamillion\Plugin\ComputedField;

use Drupal\Core\Cache\CacheableMetadata;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\computed_field\Field\ComputedFieldDefinitionWithValuePluginInterface;
use Drupal\computed_field\Plugin\ComputedField\ComputedFieldBase;
use Drupal\Component\Plugin\ConfigurableInterface;
use Drupal\Core\Plugin\PluginFormInterface;

/**
 * TODO: class docs.
 *
 * @ComputedField(
 *   id = "buy_booksamillion_Computedbuybooksamillion",
 *   label = @Translation("ComputedBuyBooksaMillion"),
 *   field_type = "text",
 *   attach = {
 *     "TODO" = "array values",
 *   },
 * )
 */
class Computedbuybooksamillion extends ComputedFieldBase {

  /**
   * {@inheritdoc}
   */
  public function computeValue(EntityInterface $host_entity, ComputedFieldDefinitionWithValuePluginInterface $computed_field_definition): array {
    // Returns the value for a computed field.
    if (!empty($host_entity->field_isbn_13_hc->value)) {
        $ISBN = $host_entity->field_isbn_13_hc->value;
    } else if (!empty($host_entity->field_isbn_13_pb_->value)) {
        $ISBN = $host_entity->field_isbn_13_pb_->value;
     } else if (!empty($host_entity->field_isbn_13_au_->value)) {
        $ISBN = $host_entity->field_isbn_13_au_->value;
    } else {
		$ISBN = '';
    }
    
	if(empty($ISBN)) {
		$value = '<div>Not Available at booksamillion.com</div>';
        return [
            0 => [
            'value' => $value,
            'format' => 'full_html',
            ],
        ];    
	} 

	if(!empty($ISBN)) {
		$value = '<a href="http://www.booksamillion.com/p/Catherine-Coulter/'.$ISBN.'?id=6378422423141" target="_blank">Books-A-Million</a>';
        return [
            0 => [
            'value' => $value,
            'format' => 'full_html',
            ],
        ];    
	} 
  }

}

Like I said, the whole thing is just to insert the ISBN into the URL and display it as a link. I know it's not very elegant, but it works for now. It kept throwing empty array errors if none of the ISBN fields were filed in, so I added the if(empty) bit to pass the Not Available link. I'd rather it just didn't show anything if there is no data, but it works for now. I hope this helps you a bit.

🇺🇸United States wxman

@mts11 Yes I was able to get Computed Fields 4.0.0-alpha6 to work with Views after I finally upgraded to Drupal 10. My plug-ins are not the best design, but they do the job well enough. I was getting empty array errors because sometimes the fields it was drawing the data from were empty. I had to fake it by checking to see if there is data, and if none, it passed a message saying there was no data. I would rather it just showed blank. If anyone is interested, I can post what I made here. They are fairly simple examples though.

🇺🇸United States wxman

On the last couple I did, I just manually added the ^10 in the composer.json. Also changed to drush line to ^12. Then it's just composer update to finish.

🇺🇸United States wxman

I made it simple on myself and made three different plugins, one for each field. After I get all the sites updated and working I'll try to combine them into a single plugin.

🇺🇸United States wxman

@joachim I installed the DEV version of Field Permissions and Computed Field, and everything else, works with no errors.

🇺🇸United States wxman

@gcb I am running the 8.x-1.2 version now and computed field still is not working, even my cron fails showing an error caused by Field Permissions
TypeError: Drupal\field_permissions\FieldPermissionsService::fieldGetPermissionType(): Argument #1 ($field) must be of type Drupal\field\FieldStorageConfigInterface, Drupal\computed_field\Field\FieldStorageDefinition given, called in /var/www/website/web/modules/contrib/field_permissions/src/FieldPermissionsService.php on line 163 in Drupal\field_permissions\FieldPermissionsService->fieldGetPermissionType() (line 138 of modules/contrib/field_permissions/src/FieldPermissionsService.php).

I'm going to do a backup and install the DEV an see if that works. Also the link above: https://git.drupalcode.org/project/field_permissions/-/commit/003b4f069a... says the fix was NOT added to the branch, unless I'm reading it wrong.

🇺🇸United States wxman

@jhedstrom @mariacha1 This bug is still not working. I created a new issue at #3394215 to show it's still crashing Computed Fields.

🇺🇸United States wxman

Unfortunately that was the only issue that sounds like the problem. I posted there but I have no idea how fast they respond. I wish I could do without the module but I kind of need it.

🇺🇸United States wxman

Great. So this means it's a bug at Field Permissions?

🇺🇸United States wxman

@joachim I posted over in the Field Permissions issues. I can't find where this could be killing it, but it does look like something here doesn't like field permissions. Line #36 in field_permissions.module is:

31  /**
32   * Implements hook_entity_field_access().
33   */
34  function field_permissions_entity_field_access($operation, FieldDefinitionInterface $field_definition, $account, FieldItemListInterface $items = NULL) {
35    $context = ($operation == 'view') ? 'display' : 'edit';
36    if (!$field_definition->isDisplayConfigurable($context) || empty($items)) {
37      return AccessResult::neutral();
38    }
39    $access_field = \Drupal::service('field_permissions.permissions_service')->getFieldAccess($operation, $items, $account, $field_definition);
40  if (!$access_field) {
41      return AccessResult::forbidden();
42    }
43    return AccessResult::neutral();
44  }
🇺🇸United States wxman

I found one that the 'view' is missing from the end

  0 => array:7 [▼
    "file" => "/var/www/vhosts/theliterarytimes.com/newsite/web/modules/contrib/field_permissions/field_permissions.module"
    "line" => 36
    "function" => "isDisplayConfigurable"
    "class" => "Drupal\computed_field\Entity\ComputedField"
    "object" => Drupal\computed_field\Entity\ComputedField {#2240 ▼
      #entityTypeId: "computed_field"
      #enforceIsNew: null
      #typedData: null
      #cacheContexts: []
      #cacheTags: []
      #cacheMaxAge: -1
      #_serviceIds: []
      #_entityStorages: []
      #originalId: "node.book_page.computed_buy_amazon"
      #status: true
      #uuid: "794b4003-cd4a-4202-aca5-af1f2588ba57"
      -isUninstalling: false
      #langcode: "en"
      #third_party_settings: []
      #_core: []
      #trustedData: false
      #dependencies: array:2 [▶]
      #isSyncing: false
      #id: "node.book_page.computed_buy_amazon"
      #field_name: "computed_buy_amazon"
      #field_type: null
      #entity_type: "node"
      #bundle: "book_page"
      #label: "Buy Amazon"
      #description: ""
      #settings: []
      #required: false
      #translatable: true
      #default_value: []
      #default_value_callback: ""
      #fieldStorage: null
      #itemDefinition: null
      #constraints: []
      #propertyConstraints: []
      #plugin_id: "buy_amazon_computedbuyamazon"
      #plugin_config: []
      #pluginCollection: Drupal\Core\Plugin\DefaultSingleLazyPluginCollection {#3238 ▼
        #pluginInstances: array:1 [ …1]
        #instanceIds: array:1 [ …1]
        #manager: Drupal\computed_field\ComputedFieldManager {#3243 …16}
        #configuration: []
        #instanceId: "buy_amazon_computedbuyamazon"
        #_serviceIds: []
        #_entityStorages: []
      }
    }
    "type" => "->"
    "args" => array:1 [▼
      0 => "display"
    ]
  ]
🇺🇸United States wxman

@joachim I'm sorry for being inexperienced in this, but would that logically be at the bottom of the long list? There is around 300 of the arrays with more sub arrays.

🇺🇸United States wxman

@joachim >You need to read through the array. Each item is a step up the chain of calls that got us here. We need to know who called this with a crappy parameter.

Can you give me a hint what to look for? There are A LOT of arrays!

🇺🇸United States wxman

@joachim I added it and got only this:

ParseError: syntax error, unexpected identifier "view" in Composer\Autoload\{closure}() (line 298 of /var/www/host/website.com/newsite/web/modules/contrib/computed_field/src/Entity/ComputedField.php)

If I comment out the function:

  public function isDisplayConfigurable($context) {
	  dsm(debug_backtrace());
/*	  
    return match ($context) {
     'view' => TRUE,
     'form' => FALSE,
    };
*/
  }

I get a page of array's :

array:34 [▶]

array:42 [▶]

array:39 [▶]

Each array is composed of a lot of sub arrays. Any idea what I'm looking for in there? I wish I could just leave the function commented out because it works fine like that.

🇺🇸United States wxman

@joachim To do a backtrace in D10 is it through the Devel, or the knit modules? I don't see it in that. I installed the Devel module but like I said, I never seen to find it showing the info I want. When I go to a book page it's just a white page with the php error at the top.

🇺🇸United States wxman

If I just put a simple echo in the function:

  public function isDisplayConfigurable($context) {
echo $context;
    return match ($context) {
      'view' => TRUE,
      'form' => FALSE,
    };
  }

I got "viewviewviewviewviewview".

🇺🇸United States wxman

@Joachim I'm working on setting up a debug on my regular site, but I've never had much luck making those work.

I'm also still using:

        "patches": {
            "drupal/core": {
                "computed base fields to work in Views": "https://git.drupalcode.org/project/drupal/-/merge_requests/4224.diff"
            }
        },

I made a exact same setup on an empty D10 site with the same computed field, the exact same fields, the same custom module, patch, and nothing else. It's working perfectly. No errors. I'll keep working on trying to set up a debug on the regular site.

🇺🇸United States wxman

@Joachim I tried to manually follow through the code but couldn't figure it out. I don't suppose you know a trick I can try?
The other thing I can try is build a dummy site with nothing but Computed Field on it. Maybe that might show something.

🇺🇸United States wxman

That was one I looked at but it doesn't look like it's being developed for D10. The plugin page on Facebook makes it sound like I shouldn't need any modules, only their code. The example works great there but only a link shows when added to the site. 

🇺🇸United States wxman

@heddn That did it! No errors, and I can edit the star ratings. You folks are great.

🇺🇸United States wxman

@heddn when you update the branch like that do we leave the patch in as is, or remove it and just run composer require 'drupal/fivestar:^1.0@alpha'

🇺🇸United States wxman

@heddn Sorry to be a pain. I added the patch and ran this:

@server2:~/newsite$ composer require 'drupal/fivestar:^1.0@alpha'
./composer.json has been updated
Running composer update drupal/fivestar
Gathering patches for root package.
Removing package drupal/fivestar so that it can be re-installed and re-patched.
  - Removing drupal/fivestar (1.0.0-alpha4)
Deleting web/modules/contrib/fivestar - deleted
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
Gathering patches for root package.
Gathering patches for dependencies. This might take a minute.
  - Installing drupal/fivestar (1.0.0-alpha4): Extracting archive
  - Applying patches for drupal/fivestar
    https://git.drupalcode.org/project/fivestar/-/merge_requests/14.patch (#3324052 Deprecated function addcslashes)
   Could not apply patch! Skipping. The error was: Cannot apply patch https://git.drupalcode.org/project/fivestar/-/merge_requests/14.patch
    https://www.drupal.org/files/issues/2023-10-02/fivestar-access-check-3391088-2.patch (#3391088 Entity queries must explicitly set)

My composer.json looks like this in the extra section:

    "extra": {
        "patches": {
            "drupal/fivestar": {
                "#3324052 Deprecated function addcslashes": "https://git.drupalcode.org/project/fivestar/-/merge_requests/14.patch",
                "#3391088 Entity queries must explicitly set": "https://www.drupal.org/files/issues/2023-10-02/fivestar-access-check-3391088-2.patch"
                }
        },

Sometimes I miss the obvious.

🇺🇸United States wxman

That was my fault. The patch does work, I just formatted it wrong. Very fussy that composer.json is sometimes. The patch did apply and that error went away. I'm still left with one error, but I'm working on it.

🇺🇸United States wxman

I'm getting nothing but the error on any page that has Fivestar. I'm using the alph4 release, but I don't get which MR or patch I should be using? It's a bit confusing. Thanks

🇺🇸United States wxman

Is the patch I said I am using in #3 still the correct one when using alpha4?

🇺🇸United States wxman

Would this be the reason my newly upgraded to D10 is now showing me this:
Drupal\Core\Entity\Query\QueryException: Entity queries must explicitly set whether the query should be access checked or not. See Drupal\Core\Entity\Query\QueryInterface::accessCheck(). in Drupal\Core\Entity\Query\Sql\Query->prepare() (line 141 of core/lib/Drupal/Core/Entity/Query/Sql/Query.php).

It's happening on every page that has fivestar on it. I'm using the alpha4 release, and added this to the composer.json:

        "drupal/fivestar": {
            "#3391088 Entity queries must explicitly set": "https://www.drupal.org/files/issues/2023-10-02/fivestar-access-check-3391088-2.patch"
        },

Something might not be working with the patch though because I don't see it being applied when I run composer update.

🇺🇸United States wxman

PHP 8.1.23; Memory limit 256M

Field visibility and permissions: Not set
Number of stars: Five Stars
Allow users to cancel their ratings.
Allow users to vote on their own content.
Select when user can rate the field: Rated while viewing
Allowed number of values: 1

🇺🇸United States wxman

@heddn I did as you asked: https://www.drupal.org/project/fivestar/issues/3391065 💬 Deprecated function: addcslashes Error on new D10 Site Active .

🇺🇸United States wxman

Well I made the leap to D10. I installed the latest Fivestar Alpha4. The only error on the the site is Fivestar though. I'm still getting:

Deprecated function: addcslashes(): Passing null to parameter #1 ($string) of type string is deprecated in Drupal\Core\Database\Connection->escapeLike() (line 1525 of core/lib/Drupal/Core/Database/Connection.php).

I also noticed that the stars can no longer be selected, or edited, like I want to give a book a rating. I know it has to be connected to Fivestar because it only occurs on pages with that field on it.

I have no other patches installing. Is there a Fivestar patch I still need that I'm missing?

🇺🇸United States wxman

That is what the instructions say isn't it? What would be correct then?

🇺🇸United States wxman

@AvO Thanks for the thought! I'm ready to upgrade most of our sites, but they keep failing for a variety of reasons, none caused by computed field at least.

🇺🇸United States wxman

@ivnish I honestly don't know what's going on now. I have gone back to a backup copy from a couple of weeks ago, and the error is there on every page there is a FiveStar field. On the pages that it's not used the error doesn't show up. The only patch I'm using is the one shown in #78.

🇺🇸United States wxman

Has something changed? I was getting ready to take the plunge to upgrade the site to 10 and even though I have things still set from #78 I'm now back five star not working and a page full of:

Deprecated function: addcslashes(): Passing null to parameter #1 ($string) of type string is deprecated in Drupal\Core\Database\Connection->escapeLike() (line 1525 of core/lib/Drupal/Core/Database/Connection.php).

Did I miss something?

🇺🇸United States wxman

@jonathan_hunt I removed everything and added the patch you said. Reran require and all is well now. Thank you.

🇺🇸United States wxman

I just tried installing the latest DEV but it wouldn't let me

🇺🇸United States wxman

I am by no means a PHP expert. I understand some of it, and look up what I don't. Please fogive me if this sounds wrong.

Upgrade Status showed three errors. One was in web/modules/contrib/fivestar/tests/src/Functional/FivestarTest.php line 145:
$this->assertRaw('No votes yet', 'Fivestar field has no votes.');
The test says it need to be changed to:
$this->assertSession()->responseContains('No votes yet', 'Fivestar field has no votes.');

The other two were library's in web/modules/contrib/fivestar/fivestar.libraries.yml for the "Remove jQuery dependency from the once feature":

fivestar.base:
  version: VERSION
  css:
    component:
      css/fivestar.css: {}
  js:
    js/fivestar.js: {}

  dependencies:
    - core/jquery
    - core/drupal
    - core/jquery.once
    - core/drupal.ajax

fivestar.admin:
  version: VERSION
  css:
    component:
      css/fivestar-admin.css: {}

fivestar.ajax:
  version: VERSION
  js:
    js/fivestar.ajax.js: {}
  dependencies:
    - core/jquery
    - core/drupal
    - core/jquery.once

I read the post regarding that at https://www.drupal.org/node/3158256 and tried this change:

fivestar.base:
  version: VERSION
  css:
    component:
      css/fivestar.css: {}
  js:
    js/fivestar.js: {}

  dependencies:
    - core/drupal
    - core/once

fivestar.admin:
  version: VERSION
  css:
    component:
      css/fivestar-admin.css: {}

fivestar.ajax:
  version: VERSION
  js:
    js/fivestar.ajax.js: {}
  dependencies:
    - core/drupal
    - core/once

I saved, flushed caches, and checked all my pages with Fivestar. Everything worked perfectly and no errors. This goes along with the MR and patch I posted above that come from the people that really do know what they are doing. Upgrade Status still has two errors left on the web/modules/contrib/fivestar/fivestar.info.yml, and web/modules/contrib/fivestar/composer.json that complain about core_version_requirement and drupal/core requirement but that is just a simple fix. Is what I did wrong, because it seems to work?

🇺🇸United States wxman

@markus_cz I've been watching this too for the same reason. I have the whole site ready to upgrade to 10 except for FiveStar. If it's any help to you, Here are parts of my composer.json that I applied patches and MR's:

     "repositories": {
        "fivestar" : {
            "type": "package",
            "package": {
                "name": "drupal/fivestar",
                "type": "drupal-module",
                "version": "1.x-dev",
                "source": {
                    "type": "git",
                    "url": "https://git.drupalcode.org/issue/fivestar-3287600/",
                    "reference": "99e6a9bb1f6407a143d664bcb61e29d10b3de4af"
                },
                "source": {
                    "type": "git",
                    "url": "https://git.drupalcode.org/issue/fivestar-3309729/",
                    "reference": "c9dff23c0836d262052c5cf141adfd9dccab594b"
                },
                "source": {
                    "type": "git",
                    "url": "https://git.drupalcode.org/issue/fivestar-3309729/",
                    "reference": "b696efe72c91170095a9f90dbe271fbe12d8555f"
                },
                "source": {
                    "type": "git",
                    "url": "https://git.drupalcode.org/issue/fivestar-3324052/",
                    "reference": "51b40c765a37cf34140996e325f2551462d9857e"
                }
            }
        },
        "drupal": {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        },
        "0": {
            "type": "vcs",
            "url": "https://github.com/mcaskill/composer-merge-plugin"
        }
    },
    
    
    "require": {
        "drupal/fivestar": "1.x-dev@dev",
    },

    "extra": {
        "patches": {
            "drupal/fivestar": {
                "Remove fivestar_preview theme function": "https://www.drupal.org/files/issues/2022-04-06/3273701_3.patch"
            }
        },
    }

So far everything is working great, and the errors have all gone. Upgrade Status still says it's not compatible though. It's my only one.

🇺🇸United States wxman

I'm going to post this just in case it might help someone else.

As you see above, this kept failing for reasons I couldn't figure out, even thought I followed all the instructions to the letter. These are the steps I did to make it work.

I went through the results on Upgrade Status and upgraded any of the modules to the latest, even if they said the version I had was compatible.

One I didn't catch right off was Metatag. It needs a two part upgrade:
composer require drupal/metatag:^2 drupal/schema_metatag:^3

After I was sure I got everything upgraded, I made a full backup. Then I uninstalled Upgrade Status module. I don't get why, but that made a big difference. After all that I ran the commands again:

chmod 777 web/sites/default
chmod 666 web/sites/default/*settings.php
chmod 666 web/sites/default/*services.yml

composer require 'drupal/core-recommended:^10' 'drupal/core-composer-scaffold:^10' 'drupal/core-project-message:^10' --update-with-dependencies --no-update

composer update
drush updatedb
drush cr

composer require 'drush/drush:^12' --with-all-dependencies

chmod 755 web/sites/default
chmod 644 web/sites/default/*settings.php
chmod 644 web/sites/default/*services.yml

I probably could have added the Drush one at the beginning, but I was trying to keep it as simple as possible. I hope this helps someone else.

🇺🇸United States wxman

No luck I'm afraid

composer require 'drupal/core-recommended:^10' 'drupal/core-composer-scaffold:^10' 'drupal/core-project-message:^10' --update-with-dependencies --no-update --ignore-platform-req=php+


composer require 'drupal/recommended-project:^10' --update-with-dependencies --no-update --ignore-platform-req=php+


composer update


  Problem 1
    - symfony/process[v4.0.0-BETA1, ..., v4.4.10] require php ^7.1.3 -> your php version (8.1.13) does not satisfy that requirement.
    - symfony/process[v5.0.0-BETA1, ..., v5.0.0-RC1] require php ^7.2.9 -> your php version (8.1.13) does not satisfy that requirement.
    - symfony/process[v5.0.0, ..., v5.1.0-RC1] require php ^7.2.5 -> your php version (8.1.13) does not satisfy that requirement.
    - drupal/core 8.0.0-beta6 requires doctrine/common dev-master#a45d110f71c323e29f41eb0696fa230e3fa1b1b5 -> found doctrine/common[dev-remove-int-cast, dev-deprec-proxy, 2.1.3, ..., 2.13.x-dev, 3.0.0, ..., 3.5.x-dev] but it does not match the constraint.
    - drupal/core[8.0.0-beta13, ..., 8.0.0-beta15] require guzzlehttp/guzzle dev-master#1879fbe853b0c64d109e369c7aeff09849e62d1e -> found guzzlehttp/guzzle[v1.0.3, v1.0.4, v2.0.0, ..., v2.8.8, v3.0.0, ..., v3.8.1, 4.0.0-rc.1, ..., 4.x-dev, 5.0.0, ..., 5.3.x-dev, 6.0.0, ..., 6.5.x-dev, 7.0.0-beta.1, ..., 7.7.x-dev] but it does not match the constraint.
    - zendframework/zend-feed[dev-master, dev-develop, 2.11.0, ..., 2.13.x-dev] require php ^5.6 || ^7.0 -> your php version (8.1.13) does not satisfy that requirement.
    - laminas/laminas-feed[2.12.0, ..., 2.12.x-dev] require php ^5.6 || ^7.0 -> your php version (8.1.13) does not satisfy that requirement.
    - symfony/psr-http-message-bridge[v1.1.0, ..., 1.1.x-dev] require php ^5.3.3 || ^7.0 -> your php version (8.1.13) does not satisfy that requirement.
    - symfony-cmf/routing[1.4.0-RC1, ..., 1.4.x-dev] require php ^5.3.9|^7.0 -> your php version (8.1.13) does not satisfy that requirement.
    - symfony/psr-http-message-bridge[v1.2.0, ..., v1.3.0] require php ^7.1 -> your php version (8.1.13) does not satisfy that requirement.
    - drupal/core[8.9.11, ..., 8.9.x-dev] require php ^7.0.8 -> your php version (8.1.13) does not satisfy that requirement.
    - drupal/core[9.0.10, ..., 9.0.x-dev] require php ^7.3 -> your php version (8.1.13) does not satisfy that requirement.
    - laminas/laminas-feed[2.13.0, ..., 2.14.x-dev] require php ^7.3 || ~8.0.0 -> your php version (8.1.13) does not satisfy that requirement.
    - Root composer.json requires drush/drush ^11.6 -> satisfiable by drush/drush[11.6.0-rc1, 11.6.0, 11.x-dev].
    - drupal/core-recommended 10.0.0-alpha1 requires drupal/core 10.0.0-alpha1 -> satisfiable by drupal/core[10.0.0-alpha1].
    - Conclusion: don't install drupal/core 10.0.0-alpha1 (conflict analysis result)
    - Conclusion: don't install drupal/core-recommended 10.0.0-alpha2 (conflict analysis result)
    - Conclusion: don't install drupal/core-recommended 10.0.0-alpha3 (conflict analysis result)
    - Conclusion: don't install drupal/core-recommended 10.0.0-alpha4 (conflict analysis result)
    - Conclusion: don't install drupal/core-recommended 10.0.0-alpha5 (conflict analysis result)
    - Conclusion: don't install drupal/core-recommended 10.0.0-alpha6 (conflict analysis result)
    - Conclusion: don't install drupal/core-recommended 10.0.0-alpha7 (conflict analysis result)
    - Conclusion: don't install drupal/core-recommended 10.1.0-alpha1 (conflict analysis result)
    - Conclusion: don't install drupal/core-recommended 10.0.0-beta1 (conflict analysis result)
    - Conclusion: don't install drupal/core-recommended 10.0.0-beta2 (conflict analysis result)
    - Conclusion: don't install drupal/core-recommended 10.1.0-beta1 (conflict analysis result)
    - Conclusion: don't install drupal/core-recommended 10.0.0-rc1 (conflict analysis result)
    - Conclusion: don't install drupal/core-recommended 10.0.0-rc2 (conflict analysis result)
    - Conclusion: don't install drupal/core-recommended 10.0.0-rc3 (conflict analysis result)
    - Conclusion: don't install drupal/core-recommended 10.1.0-rc1 (conflict analysis result)
    - Conclusion: don't install drupal/core-recommended 10.0.0 (conflict analysis result)
    - Conclusion: don't install drupal/core-recommended 10.0.1 (conflict analysis result)
    - Conclusion: don't install drupal/core-recommended 10.0.2 (conflict analysis result)
    - Conclusion: don't install drupal/core-recommended 10.0.3 (conflict analysis result)
    - Conclusion: don't install drupal/core-recommended 10.0.4 (conflict analysis result)
    - Conclusion: don't install drupal/core-recommended 10.0.5 (conflict analysis result)
    - Conclusion: don't install drupal/core-recommended 10.0.6 (conflict analysis result)
    - Conclusion: don't install drupal/core-recommended 10.0.7 (conflict analysis result)
    - Conclusion: don't install drupal/core-recommended 10.0.8 (conflict analysis result)
    - Conclusion: don't install drupal/core-recommended 10.0.9 (conflict analysis result)
    - Conclusion: don't install drupal/core-recommended 10.0.10 (conflict analysis result)
    - Conclusion: don't install drupal/core-recommended 10.1.0 (conflict analysis result)
    - Conclusion: don't install drupal/core-recommended 10.1.1 (conflict analysis result)
    - drupal/upgrade_status[3.0.0-beta1, ..., 3.1.0] require drupal/core ^8 -> satisfiable by drupal/core[8.0.0-beta6, ..., 8.9.x-dev].
    - drupal/upgrade_status[3.2.0, ..., 3.4.0] require drupal/core ^8.7.0 -> satisfiable by drupal/core[8.7.0-alpha1, ..., 8.9.x-dev].
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 9.1.15.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 9.1.14.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 9.1.13.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 9.1.12.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 9.1.11.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 9.1.10.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 9.1.9.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 9.1.8.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 9.1.7.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 9.1.6.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 9.1.5.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 9.1.4.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 9.1.3.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 9.1.2.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 9.1.1.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 9.1.0.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 9.1.0-rc3.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 9.1.0-rc2.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 9.1.0-rc1.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 9.1.0-beta1.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 9.1.0-alpha1.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 9.0.9.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 9.0.8.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 9.0.7.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 9.0.6.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 9.0.5.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 9.0.4.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 9.0.3.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 9.0.2.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 9.0.1.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 9.0.0.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 9.0.0-rc1.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 9.0.0-beta3.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 9.0.0-beta2.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 9.0.0-beta1.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 8.1.10.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 8.1.9.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 8.1.8.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 8.1.7.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 8.1.6.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 8.1.5.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 8.1.4.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 8.1.3.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 8.1.2.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 8.1.1.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 8.1.0.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 8.1.0-rc1.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 8.1.0-beta2.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 8.1.0-beta1.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 8.0.6.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 8.0.5.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 8.0.4.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 8.0.3.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 8.0.2.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 8.0.1.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 8.0.0.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 8.0.0-rc4.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 8.0.0-rc3.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 8.0.0-rc2.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 8.0.0-rc1.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 8.0.0-beta16.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 8.0.0-beta12.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 8.0.0-beta11.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 8.0.0-beta10.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 8.0.0-beta9.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 8.0.0-beta7.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 9.1.x-dev.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 8.1.x-dev.
    - drush/drush[11.6.0-rc1, ..., 11.x-dev] conflict with drupal/core 8.0.x-dev.
    - drupal/core[8.4.0-alpha1, ..., 8.7.7] require symfony-cmf/routing ^1.4 -> satisfiable by symfony-cmf/routing[1.4.0-RC1, ..., 1.4.x-dev].
    - drupal/core[8.2.0-beta1, ..., 8.3.x-dev] require symfony-cmf/routing ~1.4 -> satisfiable by symfony-cmf/routing[1.4.0-RC1, ..., 1.4.x-dev].
    - drupal/core[9.0.0-alpha1, ..., 9.0.0-alpha2] require symfony/psr-http-message-bridge ^1.2.0 -> satisfiable by symfony/psr-http-message-bridge[v1.2.0, v1.3.0].
    - drupal/core[8.7.8, ..., 8.9.10] require symfony/psr-http-message-bridge ^1.1.2 -> satisfiable by symfony/psr-http-message-bridge[v1.1.2, 1.1.x-dev, v1.2.0, v1.3.0].
    - drupal/core[8.8.0-alpha1, ..., 8.8.x-dev] require zendframework/zend-feed ^2.12 -> satisfiable by laminas/laminas-feed[2.12.0, ..., 2.22.x-dev], zendframework/zend-feed[2.12.0, 2.12.x-dev, 2.13.x-dev].
    - Conclusion: don't install drupal/core-recommended 10.1.x-dev (conflict analysis result)
    - drupal/upgrade_status[3.5.0, ..., 3.19.0] require drupal/core ^8 || ^9 -> satisfiable by drupal/core[8.0.0-beta6, ..., 8.9.x-dev, 9.0.0-alpha1, ..., 9.5.x-dev].
    - drupal/upgrade_status[3.11.0, ..., 3.14.0] require symfony/process ^3.4|^4.0|^5.0 -> satisfiable by symfony/process[v3.4.0-BETA1, ..., 3.4.x-dev, v4.0.0-BETA1, ..., 4.4.x-dev, v5.0.0-BETA1, ..., 5.4.x-dev].
    - You can only install one version of a package, so only one of these can be installed: drupal/core[8.0.0-beta6, ..., 8.9.x-dev, 9.0.0-alpha1, ..., 9.5.x-dev, 10.0.0-alpha1, ..., 10.1.x-dev].
    - You can only install one version of a package, so only one of these can be installed: drupal/core[8.7.0-alpha1, ..., 8.9.x-dev, 9.0.0-alpha1, ..., 9.5.x-dev, 10.0.0-alpha1, ..., 10.1.x-dev].
    - You can only install one version of a package, so only one of these can be installed: symfony/process[v2.1.0, ..., 2.8.x-dev, v3.2.0-BETA1, ..., 3.4.x-dev, v4.0.0-BETA1, ..., 4.4.x-dev, v5.0.0-BETA1, ..., 5.4.x-dev, v6.0.0-BETA1, ..., 6.4.x-dev].
    - drupal/core-recommended 10.0.x-dev requires drupal/core 10.0.x-dev -> satisfiable by drupal/core[10.0.x-dev].
    - drupal/core-recommended 10.0.x-dev requires symfony/process ~v6.2.5 -> satisfiable by symfony/process[v6.2.5, ..., 6.2.x-dev].
    - Root composer.json requires drupal/core-recommended ^10 -> satisfiable by drupal/core-recommended[10.0.0-alpha1, ..., 10.1.x-dev].
    - Root composer.json requires drupal/upgrade_status ^3.0@beta -> satisfiable by drupal/upgrade_status[3.0.0-beta1, ..., 3.19.0].
🇺🇸United States wxman

@ TolstoyDotCom   Which command would I add that to?

🇺🇸United States wxman

I tried adding the MR in #15 in that topic but mine is still showing those errors for D10 upgrades

🇺🇸United States wxman

Even after all the MR and patches the D10 testing still shows the FivestarTest.php 'assertRaw()' error.
The other two are connected with web/modules/contrib/fivestar/fivestar.libraries.yml. The 'fivestar.base' library, and 'fivestar.ajax' library depending on the core/jquery.once asset library.

🇺🇸United States wxman

@O'Briat I think I did it! I just couldn't figure out the reference hash, but I think I got it right.

    "repositories": {
        "fivestar" : {
            "type": "package",
            "package": {
                "name": "drupal/fivestar",
                "type": "drupal-module",
                "version": "1.x-dev",
                "source": {
                    "type": "git",
                    "url": "https://git.drupalcode.org/issue/fivestar-3287600/",
                    "reference": "99e6a9bb1f6407a143d664bcb61e29d10b3de4af"
                },
                "source": {
                    "type": "git",
                    "url": "https://git.drupalcode.org/issue/fivestar-3324052/",
                    "reference": "51b40c765a37cf34140996e325f2551462d9857e"
                }
            }
        },
        "drupal": {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        },
        "0": {
            "type": "vcs",
            "url": "https://github.com/mcaskill/composer-merge-plugin"
        }
    },

Ran composer update, the drush cr, and all the errors are gone completely. Now after all of this I'm guessing none of it will work on a D10 site yet?

🇺🇸United States wxman

@O'Briat My main site will be D10 as soon as I can get this all fixed. Fivestar is the last one I need to get working. My temporary site I just made used the latest D9 version, and 8.x-1.x-dev for Fivestar. It's working great with no errors at all. That seems to mean something else on my main site is causing the error.
As a test on my main D9 site witch is using 8.x-1.x-dev, and the edited JSON, I went to the book page it's on and removed the block with the Fivestar rating. The error went away, I added the field back in and the error returned.

🇺🇸United States wxman

@O'Briat I probably have a bigger problem then. I just made a D9 test site, installed 8.x-1.x-dev, edited the composer.json as you suggested, and added a Fivestar field to a test content. It's working fine with no errors. There must be something else conflicting with it on the other site that's causing the error.

🇺🇸United States wxman

To answer #48 I did not change anything like that.

To answer #47. If you see in my response #45, that is what my composer.json looked like. My other question was regarding whether I should change the 'require' on my composer.json which is "drupal/fivestar": "^1.0@alpha", to match your version in the repository: "version": "1.x-dev",?

I know it's long but here's the error

Deprecated function: addcslashes(): Passing null to parameter #1 ($string) of type string is deprecated in Drupal\Core\Database\Connection->escapeLike() (line 1525 of /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Database/Connection.php)

#0 /var/www/vhosts/website.com/testsite/web/core/includes/bootstrap.inc(347): _drupal_error_handler_real()
#1 [internal function]: _drupal_error_handler()
#2 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Database/Connection.php(1525): addcslashes()
#3 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Database/Query/Select.php(431): Drupal\Core\Database\Connection->escapeLike()
#4 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Entity/Query/Sql/Condition.php(125): Drupal\Core\Database\Query\Select->escapeLike()
#5 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Entity/Query/Sql/Condition.php(70): Drupal\Core\Entity\Query\Sql\Condition::translateCondition()
#6 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Entity/Query/Sql/Query.php(177): Drupal\Core\Entity\Query\Sql\Condition->compile()
#7 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Entity/Query/Sql/Query.php(81): Drupal\Core\Entity\Query\Sql\Query->compile()
#8 /var/www/vhosts/website.com/testsite/web/modules/contrib/fivestar/src/Element/Fivestar.php(273): Drupal\Core\Entity\Query\Sql\Query->execute()
#9 /var/www/vhosts/website.com/testsite/web/modules/contrib/fivestar/src/Element/Fivestar.php(85): Drupal\fivestar\Element\Fivestar::userCanVote()
#10 [internal function]: Drupal\fivestar\Element\Fivestar::process()
#11 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Form/FormBuilder.php(1012): call_user_func_array()
#12 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Form/FormBuilder.php(1075): Drupal\Core\Form\FormBuilder->doBuildForm()
#13 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Form/FormBuilder.php(579): Drupal\Core\Form\FormBuilder->doBuildForm()
#14 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Form/FormBuilder.php(325): Drupal\Core\Form\FormBuilder->processForm()
#15 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Form/FormBuilder.php(224): Drupal\Core\Form\FormBuilder->buildForm()
#16 /var/www/vhosts/website.com/testsite/web/modules/contrib/fivestar/src/Plugin/Field/FieldFormatter/StarsFormatter.php(127): Drupal\Core\Form\FormBuilder->getForm()
#17 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Field/FormatterBase.php(89): Drupal\fivestar\Plugin\Field\FieldFormatter\StarsFormatter->viewElements()
#18 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php(265): Drupal\Core\Field\FormatterBase->view()
#19 /var/www/vhosts/website.com/testsite/web/core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php(266): Drupal\Core\Entity\Entity\EntityViewDisplay->buildMultiple()
#20 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Entity/EntityViewBuilder.php(340): Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay->buildMultiple()
#21 /var/www/vhosts/website.com/testsite/web/core/modules/node/src/NodeViewBuilder.php(24): Drupal\Core\Entity\EntityViewBuilder->buildComponents()
#22 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Entity/EntityViewBuilder.php(282): Drupal\node\NodeViewBuilder->buildComponents()
#23 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Entity/EntityViewBuilder.php(239): Drupal\Core\Entity\EntityViewBuilder->buildMultiple()
#24 [internal function]: Drupal\Core\Entity\EntityViewBuilder->build()
#25 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(101): call_user_func_array()
#26 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/Renderer.php(788): Drupal\Core\Render\Renderer->doTrustedCallback()
#27 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/Renderer.php(374): Drupal\Core\Render\Renderer->doCallback()
#28 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender()
#29 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Template/TwigExtension.php(581): Drupal\Core\Render\Renderer->render()
#30 /var/www/vhosts/website.com/testsite/web/sites/default/files/php/twig/64bd70f4915fd_views-view-mlayout-5.html_ANXr5Onzt4biZh4u827kbUT5-/oU5uBauK5Ox6_MWEHR8fS9OZp_RzdDMED5l_znZnIUY.php(103): Drupal\Core\Template\TwigExtension->renderVar()
#31 /var/www/vhosts/website.com/testsite/vendor/twig/twig/src/Template.php(405): __TwigTemplate_e2e546e79f8e3b21f07a2b6002aa3215->doDisplay()
#32 /var/www/vhosts/website.com/testsite/vendor/twig/twig/src/Template.php(378): Twig\Template->displayWithErrorHandling()
#33 /var/www/vhosts/website.com/testsite/vendor/twig/twig/src/Template.php(390): Twig\Template->display()
#34 /var/www/vhosts/website.com/testsite/web/core/themes/engines/twig/twig.engine(55): Twig\Template->render()
#35 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Theme/ThemeManager.php(384): twig_render_template()
#36 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/Renderer.php(433): Drupal\Core\Theme\ThemeManager->render()
#37 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/Renderer.php(446): Drupal\Core\Render\Renderer->doRender()
#38 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender()
#39 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Template/TwigExtension.php(479): Drupal\Core\Render\Renderer->render()
#40 /var/www/vhosts/website.com/testsite/web/sites/default/files/php/twig/64bd70f4915fd_views-view.html.twig_KWfCQbL2kb8Qiz3628oxhPMt5/kgECs-PdVOEMvpqcJaf9yCmcTtyh-MGo6ZrqhhxHMxY.php(85): Drupal\Core\Template\TwigExtension->escapeFilter()
#41 /var/www/vhosts/website.com/testsite/vendor/twig/twig/src/Template.php(405): __TwigTemplate_db75f6aa28fbdc4591c136018f016cf5->doDisplay()
#42 /var/www/vhosts/website.com/testsite/vendor/twig/twig/src/Template.php(378): Twig\Template->displayWithErrorHandling()
#43 /var/www/vhosts/website.com/testsite/vendor/twig/twig/src/Template.php(390): Twig\Template->display()
#44 /var/www/vhosts/website.com/testsite/web/core/themes/engines/twig/twig.engine(55): Twig\Template->render()
#45 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Theme/ThemeManager.php(384): twig_render_template()
#46 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/Renderer.php(433): Drupal\Core\Theme\ThemeManager->render()
#47 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/Renderer.php(446): Drupal\Core\Render\Renderer->doRender()
#48 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender()
#49 /var/www/vhosts/website.com/testsite/web/themes/contrib/gavias_remito/gva_elements/gsc_view.php(167): Drupal\Core\Render\Renderer->render()
#50 /var/www/vhosts/website.com/testsite/web/themes/contrib/gavias_remito/gva_elements/gsc_view.php(105): Drupal\gavias_blockbuilder\shortcodes\gsc_view->sc_drupal_block()
#51 /var/www/vhosts/website.com/testsite/web/modules/contrib/gva_blockbuilder/templates/frontend/print-builder.php(85): Drupal\gavias_blockbuilder\shortcodes\gsc_view->render_content()
#52 /var/www/vhosts/website.com/testsite/web/modules/contrib/gva_blockbuilder/includes/frontend.php(92): include('...')
#53 /var/www/vhosts/website.com/testsite/web/modules/contrib/gva_blockbuilder/includes/shortcode_block.php(20): gavias_blockbuilder_frontend()
#54 /var/www/vhosts/website.com/testsite/web/modules/contrib/gva_blockbuilder/includes/core/shortcode.php(308): sc_blockbulider()
#55 [internal function]: do_shortcode_tag()
#56 /var/www/vhosts/website.com/testsite/web/modules/contrib/gva_blockbuilder/includes/core/shortcode.php(210): preg_replace_callback()
#57 /var/www/vhosts/website.com/testsite/web/modules/contrib/gva_blockbuilder/src/Plugin/Filter/Shortcode.php(40): do_shortcode()
#58 /var/www/vhosts/website.com/testsite/web/core/modules/filter/src/Element/ProcessedText.php(118): Drupal\gavias_blockbuilder\Plugin\Filter\Shortcode->process()
#59 [internal function]: Drupal\filter\Element\ProcessedText::preRenderText()
#60 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(101): call_user_func_array()
#61 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/Renderer.php(788): Drupal\Core\Render\Renderer->doTrustedCallback()
#62 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/Renderer.php(374): Drupal\Core\Render\Renderer->doCallback()
#63 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender()
#64 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Template/TwigExtension.php(479): Drupal\Core\Render\Renderer->render()
#65 /var/www/vhosts/website.com/testsite/web/sites/default/files/php/twig/64bd70f4915fd_field.html.twig_9C5uMQbxbPdRTfdZZ1PO7ozmz/lwf3T1OJWuF072xcqDcfz-V0E8qafwG5IleVYP7GS38.php(87): Drupal\Core\Template\TwigExtension->escapeFilter()
#66 /var/www/vhosts/website.com/testsite/vendor/twig/twig/src/Template.php(405): __TwigTemplate_9301eadb69d5c3ea9e6886b2b9a6949b->doDisplay()
#67 /var/www/vhosts/website.com/testsite/vendor/twig/twig/src/Template.php(378): Twig\Template->displayWithErrorHandling()
#68 /var/www/vhosts/website.com/testsite/vendor/twig/twig/src/Template.php(390): Twig\Template->display()
#69 /var/www/vhosts/website.com/testsite/web/core/themes/engines/twig/twig.engine(55): Twig\Template->render()
#70 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Theme/ThemeManager.php(384): twig_render_template()
#71 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/Renderer.php(433): Drupal\Core\Theme\ThemeManager->render()
#72 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/Renderer.php(446): Drupal\Core\Render\Renderer->doRender()
#73 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender()
#74 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Template/TwigExtension.php(479): Drupal\Core\Render\Renderer->render()
#75 /var/www/vhosts/website.com/testsite/web/sites/default/files/php/twig/64bd70f4915fd_node.html.twig_JiTjjPoLZm2mq-Tx9g_ymGGgQ/r_0i6LXMvqd5sOU-5vejgkRuG1agjArKjpaxWC3Nk5Q.php(113): Drupal\Core\Template\TwigExtension->escapeFilter()
#76 /var/www/vhosts/website.com/testsite/vendor/twig/twig/src/Template.php(405): __TwigTemplate_ba986af2b0eac7f504389a88fa295e94->doDisplay()
#77 /var/www/vhosts/website.com/testsite/vendor/twig/twig/src/Template.php(378): Twig\Template->displayWithErrorHandling()
#78 /var/www/vhosts/website.com/testsite/vendor/twig/twig/src/Template.php(390): Twig\Template->display()
#79 /var/www/vhosts/website.com/testsite/web/core/themes/engines/twig/twig.engine(55): Twig\Template->render()
#80 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Theme/ThemeManager.php(384): twig_render_template()
#81 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/Renderer.php(433): Drupal\Core\Theme\ThemeManager->render()
#82 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender()
#83 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(242): Drupal\Core\Render\Renderer->render()
#84 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}()
#85 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(243): Drupal\Core\Render\Renderer->executeInRenderContext()
#86 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(132): Drupal\Core\Render\MainContent\HtmlRenderer->prepare()
#87 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php(90): Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse()
#88 [internal function]: Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()
#89 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(142): call_user_func()
#90 /var/www/vhosts/website.com/testsite/vendor/symfony/http-kernel/HttpKernel.php(174): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
#91 /var/www/vhosts/website.com/testsite/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#92 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()
#93 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#94 /var/www/vhosts/website.com/testsite/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#95 /var/www/vhosts/website.com/testsite/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#96 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
#97 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#98 /var/www/vhosts/website.com/testsite/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#99 /var/www/vhosts/website.com/testsite/web/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle()
#100 /var/www/vhosts/website.com/testsite/web/index.php(19): Drupal\Core\DrupalKernel->handle()
#101 {main}
🇺🇸United States wxman

I changed the version to match mine "version": "1.x-dev", changed to: "version": "1.0@alpha",
After running update I get no errors there, but I'm still getting "Deprecated function: addcslashes()" errors, and the stars are not working.

🇺🇸United States wxman

That's kind of what I did. Here's my composer.json:

    "repositories": {
        "fivestar" : {
            "type": "package",
            "package": {
                "name": "drupal/fivestar",
                "type": "drupal-module",
                "version": "1.x-dev",
                "source": {
                    "type": "git",
                    "url": "https://git.drupalcode.org/issue/fivestar-3287600/",
                    "reference": "99e6a9bb1f6407a143d664bcb61e29d10b3de4af"
                }
            }
        },
        "drupal": {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        },
        "0": {
            "type": "vcs",
            "url": "https://github.com/mcaskill/composer-merge-plugin"
        },
        "1": {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        },
        "2": {
            "type": "composer",
            "url": "https://asset-packagist.org"
        },
        "3": {
            "type": "composer",
            "url": "https://packagist.org"
        }
    },
🇺🇸United States wxman

I gave #42 a try.

  Problem 1
    - Root composer.json requires drupal/fivestar ^1.0@alpha, it is satisfiable by drupal/fivestar[1.0.0-alpha1, 1.0.0-alpha2, 1.0.0-alpha3] from composer repo (https://packag                       es.drupal.org/8) but drupal/fivestar[1.x-dev] from package repo (defining 1 package) has higher repository priority. The packages from the higher priority repository do not ma                       tch your minimum-stability and are therefore not installable. That repository is canonical so the lower priority repo's packages are not installable. See https://getcomposer.o                       rg/repoprio for details and assistance.

Not sure what's going wrong. I'm running Version: 8.x-1.0-alpha3

🇺🇸United States wxman

I finally think I have it! I changed composer.json to:

        "patches": {
            "drupal/core": {
                "computed base fields to work in Views": "https://git.drupalcode.org/project/drupal/-/merge_requests/4224.diff"
            }
        },

Not the errors are gone and the field works in Views. If anyone wants to see my simple module for an example please let me know.

🇺🇸United States wxman

Still getting the same PHP error. This is a new 10.1 test site so not much on it but my one test page.
Here's what I did. I ran 'composer require cweagans/composer-patches:~1.0 --update-with-dependencies'
Here is the exact lines I added to my composer.json:

        "patches": {
            "drupal/views": {
                "computed base fields to work in Views": "https://www.drupal.org/files/issues/2023-02-23/2981047-118.patch"
            }
        },

I ran composer update and saw:

Gathering patches for root package.
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Generating autoload files
49 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
No security vulnerability advisories found

Maybe I'm using the wrong patch URL?

🇺🇸United States wxman

I'm guessing it's #118 so I added " https://www.drupal.org/files/issues/2023-02-23/2981047-118.patch " to my composer.json . I ran 'composer update', and 'drush cr', still getting the same error. Isn't that the correct patch for a D10 site? It didn't give me any errors when I ran update, but it also didn't say it was loading the patch.

🇺🇸United States wxman

I'm sorry but I can't find any links to the core patch at https://www.drupal.org/project/drupal/issues/3349739 📌 Automatically declare computed base fields to Views Needs work .
Could you provide a link so I can add it to my composer.json and give it a test?

🇺🇸United States wxman

My 'buy_amazon.views.inc' file looks like this:

function buy_amazon_views_data() {

  $data['node_field_data']['computed_buy_amazon'] = [
    'title' => t('Buy Amazon'),
    'entity field' => 'computed_buy_amazon',
    'field' => [
      'id' => 'field',
    ],
  ];

  return $data;
}
🇺🇸United States wxman

wxman created an issue.

🇺🇸United States wxman

Did I miss something that would cause the d10_combined_3287600-34.patch to stop loading just recently? FiveStar not stopped working and I'm back to getting Deprecated function: addcslashes() errors.

🇺🇸United States wxman

Here is the module I made to go with my "computed_buy_amazon" computer field. It's at: buy_amazon\src\Plugin\ComputedField\ComputedField.php

namespace Drupal\buy_amazon\Plugin\ComputedField;

use Drupal\Component\Datetime\TimeInterface;
use Drupal\computed_field\Field\ComputedFieldDefinitionWithValuePluginInterface;
use Drupal\computed_field\Plugin\ComputedField\ComputedFieldBase;
use Drupal\Core\Cache\CacheableMetadata;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
 * @ComputedField(
 *   id = "buy_amazon_computedbuyamazon",
 *   label = @Translation("Computed buy Amazon"),
 *   field_type = "text",
 *   attach = {
 *     "scope" = "base",
 *     "field_name" = "buy_amazon_computedbuyamazon",
 *     "entity_types" = {
 *       "entity_test" = {},
 *     },
 *   }
 * )
 */
class Computedbuyamazon extends ComputedFieldBase {

  /**
   * {@inheritdoc}
   */
  public function ComputeValue(EntityInterface $host_entity, ComputedFieldDefinitionWithValuePluginInterface $computed_field_definition): array {
	if(!empty($host_entity->field_isbn10->value)) {
		$ISBN = $host_entity->field_isbn10->value;
	}else{
		if(!empty($host_entity->field_amazon_asin->value)) {
			$ISBN = $host_entity->field_amazon_asin->value;
		}else{
			$ISBN = '';
		}
	}
	if(!empty($ISBN)) {
		$value = '<a href="http://www.amazon.com/gp/product/'.$ISBN.'" alt="" style="border:none !important; margin:0px !important;" />';
        return [
            0 => [
            'value' => $value,
            'format' => 'full_html',
            ],
        ];    
	}
  }

}

I'm guessing it's somewhere in here I need to add a hook to make it seen in Views? I tried following the Drupal site information but nothing worked.

🇺🇸United States wxman

I guess I'm going to have to wait till it gets fixed in Views. No matter what I try it still will not show in my View.

🇺🇸United States wxman

Do I add that to a new custom module, or to the custom module I made at /web/modules/custom/buy_amazon?
/web/modules/custom/buy_amazon/src/Plugin/ComputedField/Computedbuyamazon.php

Production build 0.69.0 2024