Files
igny8/QUICK-FIX-NOW.md
alorig ab15546979 1
2025-11-22 09:23:22 +05:00

3.2 KiB

QUICK FIX - INJECT TEST DATA NOW

🚨 IMMEDIATE ACTION TO FIX THE PAGE

The page is empty because WordPress hasn't pushed data yet. Here's how to fix it RIGHT NOW:


SOLUTION: Run This Command

Open your terminal where Docker is available and run:

docker exec -it igny8_backend python manage.py shell

Then paste this code:

from igny8_core.business.integration.models import SiteIntegration
from igny8_core.auth.models import Site
from django.utils import timezone

# Get site 5
site = Site.objects.get(id=5)
print(f"Site: {site.name}")

# Get or create WordPress integration
integration, created = SiteIntegration.objects.get_or_create(
    site=site,
    platform='wordpress',
    defaults={
        'is_active': True,
        'sync_enabled': True,
        'config_json': {}
    }
)

print(f"Integration ID: {integration.id} (created: {created})")

# Add structure data
integration.config_json = {
    'content_types': {
        'post_types': {
            'post': {
                'label': 'Posts',
                'count': 150,
                'enabled': True,
                'fetch_limit': 100
            },
            'page': {
                'label': 'Pages',
                'count': 25,
                'enabled': True,
                'fetch_limit': 100
            },
            'product': {
                'label': 'Products',
                'count': 89,
                'enabled': True,
                'fetch_limit': 100
            }
        },
        'taxonomies': {
            'category': {
                'label': 'Categories',
                'count': 15,
                'enabled': True,
                'fetch_limit': 100
            },
            'post_tag': {
                'label': 'Tags',
                'count': 234,
                'enabled': True,
                'fetch_limit': 100
            },
            'product_cat': {
                'label': 'Product Categories',
                'count': 12,
                'enabled': True,
                'fetch_limit': 100
            }
        },
        'last_structure_fetch': timezone.now().isoformat()
    },
    'plugin_connection_enabled': True,
    'two_way_sync_enabled': True
}

integration.save()
print("✓ Structure data saved!")
print(f"Integration ID: {integration.id}")
exit()

🔄 THEN: Refresh the Page

After running that command, go to your browser and refresh:

https://app.igny8.com/sites/5/settings?tab=content-types

You should now see:

  • Post Types (Posts, Pages, Products)
  • Taxonomies (Categories, Tags, Product Categories)
  • Last structure fetch timestamp

📝 WHAT THIS DOES

This manually adds the WordPress structure data to the backend database, simulating what the WordPress plugin would do. This lets you verify the fix works without deploying WordPress plugin files first.


⚠️ ALTERNATIVE: If Docker Not Available

If you can't run Docker commands, you need to:

  1. Deploy the WordPress plugin files to your WordPress site
  2. Go to WordPress Admin → Settings → IGNY8 API
  3. Click "Connect to IGNY8"
  4. Wait for structure sync
  5. Refresh frontend page

TL;DR: Run the Django shell command above, then refresh the browser page. It will work!