petitphp / facetwp-p2p Goto Github PK
View Code? Open in Web Editor NEWP2P support for FacetWP
P2P support for FacetWP
Hey Petit PHP,
With the new version of FacetWP (3.0.2), the P2P facet options do not register.
I think some things have changed since the plugin was created.
Thanks,
https://www.awesomescreenshot.com/image/2796974/1c7e8d43f3609a54642ce5ac27736447
Lors de l'ajout ou de la suppression d'un lien entre un post et un user, une erreur 500 survient et bloque l'appel AJAX.
Uncaught Error: Call to undefined method P2P_Side_User::first_post_type() in /app/web/app/plugins/facetwp-p2p/facetwp-p2p.php on line 385
L'ajout du lien se fait depuis le post, aucun moyen de sélection présent côté fiche utilisateur.
J'ai ajouté une connexion p2p de type posts-to-users (custom post type) comme ceci :
p2p_register_connection_type( [
'name' => 'service_to_users',
'from' => 'service',
'to' => 'user',
] );
Enregistrement du custom post type
register_post_type(
'service',
[
'label' => __( 'Services', 'domain' ),
'labels' => [
'name' => __( 'Services', 'domain' ),
'singular_name' => __( 'Service', 'domain' ),
'add_new' => __( 'Ajouter un service', 'domain' ),
'add_new_item' => __( 'Ajouter un service', 'domain' ),
'edit_item' => __( 'Modifier le service', 'domain' ),
'new_item' => __( 'Nouveau service', 'domain' ),
'view_item' => __( 'Voir le service', 'domain' ),
'view_items' => __( 'Voir les services', 'domain' ),
'search_items' => __( 'Chercher un service', 'domain' ),
'not_found' => __( 'Aucun service trouvé.', 'domain' ),
'not_found_in_trash' => __( 'Aucun service trouvé dans la poubelle.', 'domain' ),
'menu_name' => __( 'Services', 'domain' ),
],
'menu_icon' => 'dashicons-paperclip',
'public' => false,
'exclude_from_search' => true,
'publicly_queryable' => false,
'show_ui' => true,
'show_in_nav_menus' => true,
'show_in_menu' => true,
'show_in_admin_bar' => true,
'capability_type' => [ 'service', 'services' ],
'hierarchical' => true,
'supports' => [ 'title' ],
'has_archive' => false,
'show_in_rest' => false,
'menu_position' => 25,
'can_export' => true,
]
);
J'utilise :
If P2P is wrongly installed the hook created connection is launched but doesn't return a connection here : https://github.com/petitphp/facetwp-p2p/blob/master/facetwp-p2p.php#L109
Then this throws an error.
J'ai une erreur : "Unknown column 'facet_source' in 'where clause'" quand j'utilise la fonction p2p_delete_connections
. (Je n'ai pu voir l'erreur qu'à travers une commande wp_cli).
En supprimant la ligne 304 (AND facet_source = %s
) et l'injection de donnée en dessous, la suppression se fait bien et il n'y a plus d'erreur.
Dans la base de données, la colonne "facet_source" n'existe pas (plus ?). La fonction pourrait aussi être simplifiée je pense.
Erreur de la base de données WordPress Unknown column 'facet_source' in 'where clause' pour la requête
DELETE FROM qp2_3_facetwp_index
WHERE post_id IN (28400, 21039)
AND facet_value IN (28400, 21039)
AND facet_source = 'p2p/race_to_result/courses'
faite par [...] FWP_P2P->p2p_delete_connections
Updating site to Facetwp v3.8.12 and Facetwp-p2p v3.0.0
Facetwp-p2p sources not indexing from custom post types
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.