Jump to content

[SOLVED] rockpagebuilderblock-logos changes system "title" field


Yipper
 Share

Recommended Posts

I started setting up a website and then in the process installed RockPageBuilder (and installed all the example blocks). Before that I have set the system "title" field to "TextLanguage". 

Now I wondered why my Headlines lost their multilanguage settings and saw that log:

Fields: Deleted field "title" data in 0 row(s) from 0 page(s) using template "rockpagebuilderblock-logos". [page-by-page] +2

I'm not sure how that template does that and where?

 

Edited by Yipper
Link to comment
Share on other sites

Hey @Yipper thx for the report!

3 minutes ago, Yipper said:
Fields: Deleted field "title" data in 0 row(s) from 0 page(s) using template "rockpagebuilderblock-logos". [page-by-page] +2

This comes from the "fields-" (fields minus) key in Logos.php which tells RockMigrations to remove all fields that are not listed in the array. I'm not sure why that would cause the title field to change from textLanguage to text, though.

Can you try removing the minus and let me know how/if that changes behaviour?

Link to comment
Share on other sites

24 minutes ago, bernhard said:

Can you try removing the minus and let me know how/if that changes behaviour?

u mean here, right?

//site/modules/RockFields/blocks/Logos/Logos.php (is this used or only copyied from there to site/templates/RockPageBuilder/blocks/Logos/Logos.php
'templates' => [
        $this->getTplName() => [
          'fields' => [ //removed "-"
            self::field_logos,
          ],
        ],
      ],

removed the - on both logos.php and tried commenting out the whole migrate section there. strange this is, the message from above disappears, but the field is still set back to normal text field.

Edit 1:

searching for 'fields-' => showed that this is also included in the /stubs/.Block.php  (which I thought I had from here https://www.baumrock.com/en/processwire/modules/rockpagebuilder/docs/stubs/#example-custom-php-stub , but there is no "fields-" there?!

  public function migrate()
  {
    $rm = $this->rockmigrations();
    $rm->migrate([
      'fields-' => [
        // Optional: Hinzufügen von Feldern, z. B. für Farben oder Inhalte
        "{$this->prefix}title" => ['type' => 'text', 'label' => 'Titel'],
        "{$this->prefix}content" => ['type' => 'textarea', 'label' => 'Inhalt'],
      ],
      'templates' => [
        $this->getTplName() => [
          'fields' => [
            "{$this->prefix}title",
            "{$this->prefix}content",
          ],
        ],
      ],
    ]);
  }

and therefore was added with a test block. removing the "-" alone doesn't solve it either. but commenting out the migrate() function in that test block and the logos block solves it (for now)

Edited by Yipper
added infos
Link to comment
Share on other sites

15 minutes ago, Yipper said:

removed the - on both logos.php and tried commenting out the whole migrate section there. strange this is, the message from above disappears, but the field is still set back to normal text field.

I'd not say it's strange. It makes sense. I just tried to confirm that the log you posted is not related to the issue you are seeing.

What I'd do:

Confirm that your change is coming from RockMigrations

  • To do so check "Disable all migrations" in RockMigrations module settings.
  • Then set your title field back to "textLanguage"
  • Do a modules refresh, or even better run php site/modules/RockMigrations/migrate.php from the command line (you get more logs)
  • Is your title field still "textLanguage"?
    • yes --> seems like RockMigrations is the issue
      • To confirm remove the tick on "Disable all migrations"
      • Do a modules refresh (or run migrate.php)
      • Is the title field now "text"?
        • Yes --> confirmed that RockMigrations is the issue
        • No --> should not be possible IMHO
    • no --> something else is changing the field type. maybe another module? or maybe some of your own code?

If you can confirm that RockMigrations is the issue you should have something like this somewhere in your codebase:

'type' => 'text',
"type" => "text",

The problem is that it might exist in any variation, like "type" => 'text', with or without comma, etc.;

Let me know if you find something.

  • Like 1
Link to comment
Share on other sites

31 minutes ago, Yipper said:
      'fields-' => [
        // Optional: Hinzufügen von Feldern, z. B. für Farben oder Inhalte
        "{$this->prefix}title" => ['type' => 'text', 'label' => 'Titel'],
        "{$this->prefix}content" => ['type' => 'textarea', 'label' => 'Inhalt'],
      ],

If $this->prefix is empty you set the type of the "title" field to "text", which would explain your issue!

  • Like 1
Link to comment
Share on other sites

5 minutes ago, bernhard said:

I'd not say it's strange. It makes sense. I just tried to confirm that the log you posted is not related to the issue you are seeing.

 

yes, after adding the "fields-" in the logos.php the message is back, but the problem is gone. so 

 

6 minutes ago, bernhard said:
'type' => 'text',

this was the problem in my test block (where I have no idea where I got that from)

Link to comment
Share on other sites

  • Yipper changed the title to [SOLVED] rockpagebuilderblock-logos changes system "title" field

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...