Implemented 3.12.4 broke your tos and privacy pages? Read this.

Status
Not open for further replies.

Rodolfo

Chevereto creator
Chevereto Staff
Hey there,

In 3.12.4, a nasty bug caused by my negligence causes that empty pages at /content/pages override both tos.php and privacy.php files. Most likely, your page files use these names so the update replaced your custom pages with empty files.

I'm having issues?

If you are experiencing issues with /pages/tos and /pages/privacy then keep reading, otherwise you aren't affected and you shouldn't mind about this as this was removed in v3.12.5. If you skip 3.12.4 then you shouldn't have issues either as the latest release is 3.12.5.

If you have issues

Unfortunately, this error can't be reverted. If you have a backup, simply re-upload the /content/pages folder and everything will work as expected.

A. Remove (or restore) both /content/pages/tos.php and /content/pages/privacy.php
B. If you don't have a backup you will need rebuild these pages. To make this process easier, you can rely on https://archive.org/web/ or even Google (for example, search for "https://demo.chevereto.com/page/tos" with quotes and then click on cache).

Note that you can navigate to /content/pages/default to get the base PHP for these pages (header and footer included).

I know that the process is awkward, sorry about that.

Cheers,
Rodolfo.
 

neoark

Network license
Beta tester
There seems to be another bug I can't add a page anymore no save button.

1544130606869.png
 

Rodolfo

Chevereto creator
Chevereto Staff
Remove (or restore) both /content/pages/tos.php and /content/pages/privacy.php
 

bee

Well-Known Member
License owner
Both files are deleted - but there is no save button to create an new page.
 

Rodolfo

Chevereto creator
Chevereto Staff
I do have the button, most likely the page is being terminated by PHP. Since I can't reproduce it, I can't help unless you guys show me the source output.
 

Rodolfo

Chevereto creator
Chevereto Staff
Please... Dashboard, Settings, Page (given page).

Right click, view page source.

Paste here.
 

bee

Well-Known Member
License owner
Can't add the complete code (Oops! We ran into some problems. Please enter a message with no more than 20000 characters.)

Page is broken after "<div id="page-type-combo">"


Code:
 <h3>Add page</h3>
            
            
            <div class="input-label">
                <label for="page_title">Title</label>
                <div class="c9 phablet-c1"><input type="text" name="page_title" id="page_title" class="text-input" value="" required placeholder="Page title"></div>
                <div class="input-below input-warning red-warning"></div>
            </div>

            <div class="input-label">
                <label for="page_is_active">Page status</label>
                <div class="c5 phablet-c1"><select type="text" name="page_is_active" id="page_is_active" class="text-input">
                    <option value="1">Active page</option>
<option value="0" selected>Inactive page (404)</option>
                </select></div>
                <div class="input-below input-warning red-warning"></div>
                <div class="input-below">Only active pages will be accessible.</div>
            </div>

            <div class="input-label">
                <label for="page_type">Type</label>
                <div class="c5 phablet-c1"><select type="text" name="page_type" id="page_type" class="text-input"  data-combo="page-type-combo">
                    <option value="internal">Internal</option>
<option value="link">Link</option>
                </select></div>
                <div class="input-below input-warning red-warning"></div>
            </div>

            <div id="page-type-combo">
 

McAtze

Network license
Beta tester
The default pages are working for me, but i couldn't create a new page. The creating page is broken like explain above.

Screenshot 2018-12-08 12.57.05.png
 

Rodolfo

Chevereto creator
Chevereto Staff
Unless you give me the actual php error triggering the premature exit of the script I won't be able to help you guys.

Here is what is below <div id="page-type-combo">:

PHP:
            <div id="page-type-combo">

                <?php

                    $pagesAll = CHV\Page::getAll();
                        $internals = [
                            'tos' => _s('Terms of service'),
                            'privacy' => _s('Privacy'),
                            'contact' => _s('Contact')
                        ];
                        $printInternals = [
                            null => _s('Extra page'),
                        ];
                        $takenInternals = [];
                        foreach ($pagesAll as $k => $v) {
                            if ($v['internal'] && $internals[$v['internal']]) {
                                $takenInternals[] = $v['internal'];
                                if (get_page()['id'] == $v['id']) {
                                    $printInternals[$v['internal']] = $internals[$v['internal']];
                                }
                            }
                        }
                        foreach ($internals as $k => $v) {
                            if (in_array($k, $takenInternals) == false) {
                                $printInternals[$k] = $v;
                            }
                        }
                        $page_internal_combo_visible = get_settings_pages()['doing'] == 'edit' ? (get_page_val('page_type') == 'internal') : true; ?>
There must be something odd in that code, most likely in one of the foreach calls.

Unfortunately, I'm not getting any error and you have the thing just in front of you, only need to enable errors and tell me the exact error. Otherwise, I will have to try to discover the issue on my own which is only a big waste of time considering that by merely enabling error reporting you could point me in the right direction.

Edit: Ok, I was able to trigger it. Working on it.
 
Last edited:
Status
Not open for further replies.
Top