octobercms / october

Self-hosted CMS platform based on the Laravel PHP Framework.
https://octobercms.com/
Other
11.02k stars 2.21k forks source link

The Tailor pagefinder field does not adopt the link when we change the language on a multilingual site #5703

Closed haralake closed 2 weeks ago

haralake commented 1 year ago

The Tailor pagefinder field does not adopt the link when we change the language on a multilingual site. In the admin in the primary language you see this: Screenshot_2

and in the secondary language this: Screenshot_3

The result is that on multilingual sites you cannot work with the pagefinder field.

Another thing I noticed is that in every record you create with the pagefinder field in the admin interface and with "multisite:sync" enabled in the blueprint, you see all the entries (which are created depending on the languages you use) in the "Parent" field. Screenshot_4

daftspunk commented 1 year ago

Hi @haralake

We could not reproduce the first issue; the link resolves for both sites, including across different themes. In your screenshot, the link has been set successfully, however, the URL is not displayed since it cannot resolve to any usable link.

Check to make sure that page selected exists in the theme for the selected site. It is possible for a link to be propagated from Site A using Theme A and when Site B uses Theme B the link can be unresolvable if the page name does not exist.

daftspunk commented 1 year ago

The second issue will be fixed in v3.2.22 when it is released.

Thanks!

haralake commented 1 year ago

Hi @haralake

We could not reproduce the first issue; the link resolves for both sites, including across different themes. In your screenshot, the link has been set successfully, however, the URL is not displayed since it cannot resolve to any usable link.

Hi @daftspunk ! I investigated it more and found that it happens when you have "multisite: sync" enabled in the blueprint that is responsible for creating records (pages). The problem has to do with the records that have been automatically created by the multisite: sync option. If you manually create the records that will be selected by the pagefinder, the problem does not occur.

daftspunk commented 1 year ago

With this information, we still cannot reproduce this using a clean installation of October CMS:

  1. Ensure a secondary site exists
  2. Update the sitemap.yaml blueprint to use multisite: sync
  3. Navigate to Settings → Sitemap
  4. Create a record, select the homepage
  5. Navigate to the second site
  6. The Reference (pagefinder) field is populated normally
haralake commented 1 year ago

With this information, we still cannot reproduce this using a clean installation of October CMS:

  1. Ensure a secondary site exists
  2. Update the sitemap.yaml blueprint to use multisite: sync
  3. Navigate to Settings → Sitemap
  4. Create a record, select the homepage
  5. Navigate to the second site
  6. The Reference (pagefinder) field is populated normally

Using a clean installation of latest October CMS v.3.2.23: With "multisite: sync" sync i'm getting the same issue

With "multisite: true" and manually creating records: true

daftspunk commented 1 year ago

Can you share your site configuration? It might be related to this.

haralake commented 1 year ago

Can you share your site configuration? It might be related to this.

I'm using LEMP stack on Ubuntu server 20.04.3 with PHP 8.1.14 and Maria db v1:10.5.12 on windows Hyper-V virtual machine.

This is my composer.json:

{
    "name": "october/october",
    "description": "Built using October CMS: The Laravel-Based CMS Engineered For Simplicity",
    "type": "project",
    "homepage": "https://octobercms.com",
    "license": "proprietary",
    "require": {
        "php": "^8.0.2",
        "october/rain": "^3.2",
        "october/all": "^3.0",
        "laravel/framework": "^9.0",
        "rainlab/translate-plugin": "^2"
    },
    "require-dev": {
        "phpunit/phpunit": "^8.5|^9.0"
    },
    "scripts": {
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "php artisan key:generate --ansi"
        ],
        "post-autoload-dump": [
            "System\\Console\\ComposerScript::postAutoloadDump"
        ],
        "post-update-cmd": [
            "System\\Console\\ComposerScript::postUpdateCmd"
        ],
        "pre-package-uninstall": [
            "System\\Console\\ComposerScript::prePackageUninstall"
        ],
        "test": [
            "phpunit --stop-on-failure"
        ]
    },
    "config": {
        "preferred-install": "dist",
        "allow-plugins": {
            "composer/installers": true
        }
    },
    "autoload": {
        "psr-4": {
            "System\\Console\\": "modules/system/console"
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "repositories": {
        "octobercms": {
            "type": "composer",
            "url": "https://gateway.octobercms.com"
        }
    }
}
daftspunk commented 1 year ago

Sorry. Please navigate to Settings → Manage Sites and show the site configuration are you using.

haralake commented 1 year ago

Sorry. Please navigate to Settings → Manage Sites and show the site configuration are you using.

Screenshot_1

Ok, i forgot to mention important information.

The issue happens only if you use "multisite:sync" on both wiki/article.yaml and site/sitemap.yaml

daftspunk commented 1 year ago

Hello

I still can't reproduce this using identical settings on the demo site and a fresh installation. It is possible if the "Edit theme" (set via Editor) is set to a theme that doesn't have the page, it will show empty like this, but it is harmless. Click the "Replace" button and you might see that the page does not appear in the dropdown.

uitlaber commented 7 months ago

Hello, I realized that when selecting Reference in the list, the elements have the wrong id (In the dropdown itself). Because of this, the correct URL is not displayed on the multisite. (/default)

daftspunk commented 2 weeks ago

I've taken looked at this today, the ID should contain the site_root_id which will often be different to the translated model's primary key. So it may look like the wrong ID, but the lookup should use site_root_id + site_id to locate the correct record. I hope this makes sense.