Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MLA Action Network site - header and footer issues #151

Closed
adonlon opened this issue Sep 24, 2021 · 17 comments
Closed

MLA Action Network site - header and footer issues #151

adonlon opened this issue Sep 24, 2021 · 17 comments

Comments

@adonlon
Copy link

adonlon commented Sep 24, 2021

  • [x ] Add to an appropriate Epic.

Tester (if different from issue creator):
Site: MLA Action Network
URL: https://action.mla.hcommons-dev.org/
Test Account:
Area (CORE, sites, profiles, groups, general): Sites
If issue discovered on dev, does it also exist on prod?

Describe the issue
The Action header and top horizontal menu items are missing; a theme header (charity hub because we care) appears instead.

The footer is also missing content.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://action.mla.hcommons-dev.org/
  2. Compare to action.mla.org
  3. Compare header.
  4. Compare footer.

Expected behavior
Prod and dev should display identically.

Screenshots
If applicable, add screenshots to help explain your problem.

Optional details, if they seem relevant

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@mikethicke
Copy link
Contributor

The header and footer are set in the Charity Hub theme options page. For some reason these options seem not to have been retained in the transfer from prod to dev. It could also be that a plugin update somehow cleared the site's options table?

See #154 for similar issue.

@rekmla
Copy link
Contributor

rekmla commented Oct 7, 2021 via email

@ericknappe
Copy link

I have completed the sync of heinlein (still running WP 4.9.6)

First question:
@adonlon, are the settings intact?

If, so I can do some upgrades (wp first) and check again.

Please list sites checked for settings

@adonlon
Copy link
Author

adonlon commented Oct 8, 2021

Action: the settings don't seem to be intact. I haven't located the footer setting yet, but social sharing options aren't retained; logo is missing. The footer is not displaying (https://action.mla.heinlein.mlacommons.org/wp-admin/admin.php?page=charityhub). On the site overall formatting from the theme seems to have been lost.

On https://president.mla.heinlein.mlacommons.org/ and https://ask.up.heinlein.mlacommons.org/ (both on 15zine) settings seem to be retained (ticket #154).

@mikethicke
Copy link
Contributor

Eric, do you just use sync_db_and_files_from_hcommons.bash to do the sync? Is there anything more to it?

@rekmla
Copy link
Contributor

rekmla commented Oct 12, 2021 via email

@mikethicke
Copy link
Contributor

Just trying to understand what is going on here.

@ericknappe
Copy link

action.mla.hcommons.org charity hub theme options query.

select option_value from wp_1000642_options where option_name='crth_admin_option';

The value is not what I expected in heinlein - string should not start with "a:328" since the string length is longer in heinlein.

I'm using https://github.com/Automattic/go-search-replace because wp cli search replace no longer works with our size db.

@mikethicke
Copy link
Contributor

Automattic's own search replace script isn't doing serialization correctly?

@ericknappe
Copy link

This theory appears to be incorrect, an option value containing a serialized array contains a number of counters. The first one "a:nnn" contains the number of array elements. Within the string are "s:" and "i:" elements, the value of an s: element contains text, for example hcommons.org in prod which is replaced with heinlein.mlacommons.org in this example. This will cause an increase in the s: value. This is the case with the charity hub admin option for action.mla.heinlein.mlacommons.org.

@ericknappe
Copy link

That being said. The option value that controls charity_hub settings in heinlein appears to be corrupt. The following small program works in prod but fails in dev.

ubuntu@heinlein:~/utils/check_option.php
`<?php

global $wpdb;
$option = $wpdb->get_row("SELECT option_name,option_value FROM wp_1000642_options WHERE option_name='crth_admin_option'");
//echo var_export($option, true);
echo $option->option_name;
echo var_export( maybe_unserialize( $option->option_value ) );
`
wp --path=/srv/www/commons/current/web/wp --url=heinlein.mlacommons.org eval-file check_option.php

@mikethicke
Copy link
Contributor

mikethicke commented Oct 13, 2021

I think the theory is correct in the end. Comparing the serialized values for crth_admin_option->additional-style, on hcommons the string length is reported as s:24458. If I unserialize, replace hcommons.org with heinlein.mlacommons.org, then re-serialize, the length is reported as s:24469 (11 characters more, which is correct). However, on heinlein it is reported as s:6533, with the serializations being otherwise identical. Way off.

So it seems that the GO script is perhaps failing to do string serialization correctly for very long strings, or maybe there is some special character that it's choking on.

@mikethicke
Copy link
Contributor

I'm pretty sure this is a bug in the go-search-replace script.

I submitted an issue here: Automattic/go-search-replace#33

@mikethicke
Copy link
Contributor

Confirmed as a bug withe the go-search-replace script: Automattic/go-search-replace#33 (comment)

@mikethicke
Copy link
Contributor

Eric:

the sync script is working and I ran it on heinlein. The option for charityhub seems to be correct. The site action.mla.heinlein.mlacommons is still not displaying correctly although the settings seem to be there.

@mikethicke
Copy link
Contributor

It turns out that CharityHub creates a custom stylesheet at /srv/www/commons/shared/blogs.dir/1000642/files/stylesheet when you click save in the admin options panel. Only then are the options stored in wp_options reflected on the front end. So it seems for charityhub sites you not only have to migrate the database, but also open the charity theme options panel and re save to trigger the regeneration of the stylesheet.

I can't actually test this theory because I can't login to the dashboard on mla.heinlein.mlacommons.org because I get a SAML error about a missing employee number.

@mikethicke
Copy link
Contributor

This appears to be fixed with a successful sync.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants