strpos issue with installation

Created on 3 January 2024, 12 months ago
Updated 30 August 2024, 4 months ago

Problem/Motivation

I tried to install the theme, but got this error immediately:

The website encountered an unexpected error. Try again later.

TypeError: strrpos(): Argument #1 ($haystack) must be of type string, array given in strrpos() (line 294 of themes/contrib/sailor/sailor.theme).

This was on a pretty clean version of Drupal 10.2. (Just a bit of migration work beforehand.)

Happy to help debug if you like.

TIA.

๐Ÿ› Bug report
Status

Needs review

Version

3.0

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States bogdog400

Live updates comments and jobs are added and updated live.
  • Needs subsystem maintainer review

    It is used to alert the maintainer(s) of a particular core subsystem that an issue significantly impacts their subsystem, and their signoff is needed (see the governance policy draft for more information). Also, if you use this tag, make sure the issue component is set to the correct subsystem. If an issue significantly impacts more than one subsystem, use needs framework manager review instead.

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @bogdog400
  • Assigned to samir_shukla
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia samir_shukla bareilly
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia samir_shukla bareilly

    Hi, I have created the patch for the above issue. Please review.

  • Status changed to Needs review 12 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia samir_shukla bareilly
  • Issue was unassigned.
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia samir_shukla bareilly
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States bogdog400

    The patch works for me and solves that problem.

    Now I'm seeing this problem:

    Warning: file_get_contents(themes/contrib/sailor/dist/css/main.css): Failed to open stream: No such file or directory in Drupal\Core\Asset\CssCollectionOptimizerLazy->generateHash() (line 43 of core/lib/Drupal/Core/Asset/AssetGroupSetHashTrait.php).
    

    It seems like the subdirectory "dist" is mentioned in several places, but I don't see it.

    For instance:

    sailor.libraries.yml:    dist/js/main.js:
    sailor.libraries.yml:      dist/css/main.css:
    

    But here are the files in my root:

    2-3412174.patch  config              images       package.json       sailor.breakpoints.yml  sailor.theme    tests
    bin              docker-compose.yml  js           package-lock.json  sailor.info.yml         screenshot.png  webpack.config.js
    composer.json    Dockerfile          LICENSE.txt  phpcs.xml          sailor.layouts.yml      scss
    composer.lock    favicon.ico         logo.svg     README.txt         sailor.libraries.yml    templates
    
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia samir_shukla bareilly

    Hi, have you followed up with the license requirements and the npm ci command mentioned on the module page. I am not sure; maybe be this can be the reason for the issue. I hope it helps.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Gautam_105@

    Gautam_105@ โ†’ made their first commit to this issueโ€™s fork.

  • Status changed to RTBC 8 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Gautam_105@

    @samir_shukla , i have tested given patch that have fixed above issue so created MR for the same and moving RTBC++

  • Status changed to Needs work 5 months ago
  • Seems like there's a merge error, pls fix the merge conflicts :)

  • First commit to issue fork.
  • Merge request !10Resolve conflict โ†’ (Open) created by chandansha
  • Status changed to Needs review 5 months ago
  • Status changed to RTBC 5 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia prem suthar Ahemdabad- Gujrat , Jodhpur - Rajsthan

    Hi,

    I have verified the strpos issue with installation with the #3412174 merge request applied cleanly in the Drupal 10 version.

    Testing Steps:
    -> Install the Drupal 10 version.
    -> Apply the Mr on the Theme.
    -> Go to the /admin/appearance and install the theme and set as a default.
    -> installed Cleanly and theme page accessible.

    Testing Results:
    Showing no errors and warnings On the theme page.

    Attached The after screenshots. Based on these results, the issue can be moved to RTBC.

    RTBC+1

  • Status changed to Needs work 5 months ago
  • Hi,
    Thanks for working on this issue. But I'm not sure why @Chandansha had to create a new MR when there was already an MR, its absolutely unnecessary to create new MR to solve merge conflicts, it could have been easily done on MR!8.
    The problem has already been addressed on MR!8, so pls fix the merge conflict as a part of that MR only instead of creating new MR for such small task and close the new MR

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia chandansha

    Hello @sourojeetpaul,
    When i pull it from 3412174-strpos_issue and check in my local i did not find any conflict changes that's why i created new Branch and created my changes in new branch.

    i followed steps to resolve conflict.
    1. Take pull from 3412174-strpos_issue.
    2. Paste command which available in show command button.
    3. Click on overview tab.
    4. And click on Resolve locally link
    5. i pasted all command which provide in this link.

    Thanks!!

  • Hi @Chandansha,
    I think a rebase is required here to solve the merge conflicts!

  • Assigned to Tirupati_Singh
  • Issue was unassigned.
  • Status changed to Needs review 5 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Tirupati_Singh

    I've resolved the merge conflicts of MR!8. Please review the changes. Getting no errors while installing the theme.

  • Status changed to Needs work 4 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia atul_ghate

    I have successfully reproduced this issue for tag 3.0.2 and applied the patch against 3.0.2, but the patch failed to apply. I also tried to reproduce this issue for the 2.x branch, but it does not exist there. I am changing the status to 'Needs Work.

  • First commit to issue fork.
  • Merge request !11Update file sailor.theme โ†’ (Open) created by Shubham_Kumar
  • Status changed to Needs review 4 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Tirupati_Singh

    Hi @atul_ghate, the issue is present on the tag 3.0.2 only as the maintainer has not published the new release for the theme. The raised issue is not present on the 2.x branch and it was fixed in the issue The website encountered an unexpected error after installation ๐Ÿ› The website encountered an unexpected error after installation. Fixed . As the code has been merged on the 2.x branch that's why the patch is not getting applied using the composer. If you'll apply the patch by cloning the project repo then it will apply with no errors. This needs maintainer review.

  • Assigned to sourojeetpaul
  • Thanks @tirupati_singh for the research. I'll roll out the new release after this issue is resolved Automated Drupal 11 compatibility fixes for sailor ๐Ÿ“Œ Automated Drupal 11 compatibility fixes for sailor Needs review
    So that the new release will be compatible with D11 with all the remaining issues being addressed.
    I'll highly appreciate if anyone can have a look at that issue and help move that forward.
    Hence keeping the issue assigned to myself as of now!

  • Hello there,
    Sorry for the delay, I got caught up on something else in the mean time. Clearing up the issue queue today.
    As per the latest conversation as the stated problem is getting resolved through another issue, thus I'm labelling it as a duplicate issue.
    I highly appreciate the contribution from all of you, so I'd be granting credits to all of you for putting in your efforts and valuable time!

    Thanks :)

Production build 0.71.5 2024