Skip Navigation

[Resolved] Creating a CPT view, next attempt

This support ticket is created 3 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 10 replies, has 2 voices.

Last updated by Christian Cox 3 years, 1 month ago.

Assisted by: Christian Cox.

Author
Posts
#1969525

Tell us what you are trying to do?
Reference: https://toolset.com/forums/topic/creating-a-cpt-view/
The problem with block editor still exists after kicking miniOrange into the void and using another 2FA tool.
In the meantime I attempted to create a CPT view in classic editor which works for the moment. When I use the Toolset widget in Elementor I can add the view and watch the working result just fine.

BUT: Go to Elementor preview or load the page, I get this crap: "The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later."
Can be reproduced, won't go away until I change the view selected in the Elementor widget to a simple test view. All other pages of my site keep loading just fine so I guess it's related to this one view.

So for now I'd like to focus on that classic View issue, not on the ongoing JSON error in block view. No idea whether these two are related.

Anything special?
Well yes: I have several CPT that are - on the same childhood level - related to another CPT on a 1:many basis. Both the parent and the children data is to be included in the view ("Aktenschrank").
"Karteikopf" is the parent, "Stammdaten" & "Kommunikation & "Adressen" are children of "Karteikopf".

No idea whether or not it is tricky when a view including relationships is placed inside an Elementor template.

The credentials I gave you are still in place. You might need to get a new snapshot due to changes (miniOrange, etc.).

#1969765

BUT: Go to Elementor preview or load the page, I get this crap: "The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later."
Hello, if you provide FTP access in the private reply fields I will be able to activate server logs to see if I can get some additional information about this error.

No idea whether or not it is tricky when a view including relationships is placed inside an Elementor template.
Nothing especially tricky here. It is unusual that the View would work in the Elementor builder but throw errors when displayed on the front-end of the site. Is this error visible on the homepage, or is there a specific URL I should visit to see the error once I have logged in?

The credentials I gave you are still in place. You might need to get a new snapshot due to changes (miniOrange, etc.).
When a support ticket is resolved, the login credentials are removed from our server for security so I no longer have access to those details. Can you please provide those credentials once more here in the private reply fields?

#1972215

I have several CPT that are - on the same childhood level - related to another CPT on a 1:many basis. Both the parent and the children data is to be included in the view ("Aktenschrank").
"Karteikopf" is the parent, "Stammdaten" & "Kommunikation & "Adressen" are children of "Karteikopf".

Where exactly can I see the problematic View in the Elementor editor to investigate this problem? If I go to Toolset > Views, I do not see a View called "Aktenschrank". Is it in an Elementor template? Which template, and where?

Also, I would like to ask for FTP credentials again so I can activate server logs to see if any back-end errors are generated when the View is loaded in te Elementor editor.

#1972747

BUT: Go to Elementor preview or load the page, I get this crap: "The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later."
I don't know whether this view was the cause but I experienced corrupted pages, mail adresses attributed to wrong users, etc., so I had to push the emergency button and restore back to a stable version (yes, staging, I know ... WIP with my provider here).
Interesting...I logged in with FTP and I can see your site has a 143MB(!!!) PHP log here:
/path/to/site/wp-content/debug.log
The crazy thing is that it is 143MB of messages since this 02:21:18 UTC today. Something was just churning out notices and warnings over and over to the point that I can't make heads or tails of the logs to do any analysis. That could bog down your server for sure, especially in a staging environment on a more economy-type hosting platform.
I suggest you download that file and take a look. I'm seeing MBs-worth of this notice:

[28-Feb-2021 09:42:27 UTC] PHP Notice:  Trying to get property 'post_content' of non-object in /path/to/site/wp-content/plugins/dynamic-content-for-elementor/class/template-system.php on line 924

Loads of these too:

[28-Feb-2021 09:43:04 UTC] PHP Notice:  Trying to get property 'base' of non-obj
ect in /path/to/site/wp-content/plugins/plugin-group
s/classes/class-plugin-groups.php on line 183
[28-Feb-2021 09:43:05 UTC] PHP Deprecated:  Methods with the same name as their
class will not be constructors in a future version of PHP; number has a deprecat
ed constructor in /path/to/site/wp-content/plugins/c
ode-snippets/php/snippet-ops.php(446) : eval()'d code on line 319
[28-Feb-2021 09:43:05 UTC] PHP Deprecated:  Methods with the same name as their
class will not be constructors in a future version of PHP; number has a deprecat
ed constructor in /path/to/site/wp-content/plugins/c
ode-snippets/php/snippet-ops.php(446) : eval()'d code on line 156

My suggestion for now is to disable the Dynamic content for Elementor plugin temporarily while testing, because it seems to be at least partially responsible for some crazy error reporting that is exploding your PHP logs and probably tying up all your server resources at the same time.

I'll stand by for your update. Let me know once the View is restored, and provide a URL where I can see this message about server capacity.

#1973743

Thanks for the input. A bigger share of those messages were due to the API code for an external service (eTermin) which I've altered now. The 'Dynamic Content for Elementor' might be interesting as it is their widget that teleports toolset views into Elementor. Other debug messages wer caused by a no-more-maintenance plugin actually for sorting plugins --> kicked into the void. Same goes for Cloudflare worker cache plugin.

The log should be reasonably clean now. Nevertheless, I need DCE back soon as the site makes large use of it in terms of conditional visibility, etc.

So back to toolset: U've set up a test view just to play around a little bit in the block editor and after a minute or so the JSON error was back. No special action by me except for setting up a container and including a field within.

I've also re-established the view that troubled me before the db went corrupted. No real troubles so far, but included in Elementor using DCE filters don't deliver results while the search functionality does.

Is DCE the only contributor that adds toolset widgets to Elementor?

Regards,

Sven

#1973889

No real troubles so far, but included in Elementor using DCE filters don't deliver results while the search functionality does.
Sorry but I don't really understand what this means, can you elaborate?

The 'Dynamic Content for Elementor' might be interesting as it is their widget that teleports toolset views into Elementor.
Is DCE the only contributor that adds toolset widgets to Elementor?
I'm not very famliar with the Dynamic Content for Elementor plugin, and I'm not sure what it does, exactly. The only Toolset-specific elements in the Elementor builder I'm aware of are those provided by Toolset and Elementor, i.e. the ones provided automatically when the Toolset and Elementor plugins are active together. If there are other 3rd-party plugins that provide additional integration between these two plugins, I am not aware of them. But it's entirely possible..is there something specific you're looking to achieve, or are you asking in general to see what other features are available out there? Maybe if I understand what you're trying to explain about delivering results, I'll understand better?

#1974189

Sorry but I don't really understand what this means, can you elaborate?

Sure: toolset views 'Search and Pagination' offers filters as well as a search box, correct? Using a filter outputs a text input field itself so I am under the impression that the search box isn't mandatory. However, when I enter values that should have a result, I receive a 'nothing found' message. Using the search box (without a filter code), the same entered value outputs expected results.

The native toolset & elementor widget you mentioned doesn't make a difference here, so lesson learned: not a DCE specific issue. Good to know about native toolset widgets though, didn't recognize them as they are at the very end of the widgets list and I hardly ever scroll down that far.

Am I using the search code in toolset in a wrong way? The view 'Aktenschrank' is back so you can check it out now.

or are you asking in general to see what other features are available out there?

In general, yes. DCE has had its reports of stability issues in the past (quite ok for about 2 - 3 years now), hence I was thinking about options. Those native toolset widgets are a beginning here.

reference to the initial issue that I had Waqar involved with already

After eliminating most of those error throwing plugins and adapting custom code respectively (code snippets) I still get the 'not a valid JSON' errors in block editor when I try to follow toolset tut videos on content templates. Seems to be triggered on auto save as it doesn't appear on coincidence with actions of mine. After adding e. g. a toolset field it can take 10 - 20 seconds and out of the air the red error line pops up.
I guess you can reproduce that yourself using your credentials (hint: I've activated elementor's "under maintenance" page, so maybe you gotta go the wp-login.php query way)

#1974223

UPDATE:
switched off several DCE extensions and widgets that I don't use anyway, now the Views widgets works. Will have to re-test search box versus field as explained before.

JSON error in block editor not yet reevaluated after the above mentioned changes.

#1974533

Sure: toolset views 'Search and Pagination' offers filters as well as a search box, correct? Using a filter outputs a text input field itself so I am under the impression that the search box isn't mandatory. However, when I enter values that should have a result, I receive a 'nothing found' message. Using the search box (without a filter code), the same entered value outputs expected results.
The "Text Search" button above the Search and Pagination editor panel inserts a specific type of text search field that behaves like the main WordPress text search feature ( for example, you would see the search results in the search archive at hidden link ). Typically you will configure this type of filter to find text in post titles and/or post contents. It typically does NOT search custom field values, but if you use the Relevanssi plugin you have that option as well.

But this is not the only type of filter that uses a text input. Other custom search filters can be integrated using text input fields, as well. For example, if you want to search for text in a specific custom field value, you would click "New Filter" above the Search and Pagination editor panel to insert a custom filter based on that specific custom field. In the configurations, you can choose to display the filter as a text input field. This field would ONLY search for text in a specific custom field, as opposed to the Text Search button, which is more flexible with Relevanssi active.

Am I using the search code in toolset in a wrong way? The view 'Aktenschrank' is back so you can check it out now.
I'm not quite sure yet, let's find out. I have placed the Aktenschrank View directly in a draft test Page. I'm using the Classic Editor on the Page to eliminate the JSON error and possibility of Elementor / DSE plugin conflicts. You can find the test Page here for now:
hidden link
Page editor, for reference:
hidden link

View editor, for reference:
hidden link

I placed the View on the Page using a standard wpv-view shortcode:

[wpv-view name="aktenschrank"]

On the front-end, I searched a few times and the results looked okay when searching for text in the first name. My search criteria and the results produced for each criteria:
Search: Marc
Results: Marcel Hesse
URL: hidden link

Search: Mar
Results: Marcel Hesse, Mariusz Macina, Markus Duchscherer
URL: hidden link

Search: Ma
Results: Marcel Hesse, Mariusz Macina, Max Payne, Jens Weismann, Markus Duchscherer, Manuel Roos, Hacer Yilmaz
URL: hidden link

Please check the draft page and let me know if the results you find are unexpected. Provide the URL of any search that produces the wrong results, and tell me exactly why the search results are incorrect. I will review your comments and give you some feedback. Let's try to focus on the filter functionality for now.

Thank you!

#1978547

OK, I've played around with it. Looks good, so maybe I simply use a shortcode widget in Elementor or the vanilla toolset widget.

The JSON error ... hm ... guess I have to live with that.

Anyway, thanks a great deal to you; got me one step farther now.

#1978637

Okay great, feel free to open new tickets as needed. Closing out here.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.