sunnyman's (sunnyman) wrote in changelog,
sunnyman's
sunnyman
changelog

[ljcom] r12360: LJSUP-12367: Common errors processing fo...

Committer: vtroitsky
LJSUP-12367: Common errors processing for promo projects
U   trunk/cgi-bin/LJ/Pay/SelfPromo.pm
U   trunk/htdocs/shop/selfpromo.bml.text.local
Modified: trunk/cgi-bin/LJ/Pay/SelfPromo.pm
===================================================================
--- trunk/cgi-bin/LJ/Pay/SelfPromo.pm	2012-07-26 13:14:37 UTC (rev 12359)
+++ trunk/cgi-bin/LJ/Pay/SelfPromo.pm	2012-07-26 14:47:41 UTC (rev 12360)
@@ -82,6 +82,18 @@
 
     # TODO: Ensure that object is not promoting at the moment in all promos!!!!
 
+    if ($type eq PROMO_OBJECT_TYPE_ENTRY()) {
+        my $cslot = LJ::Pay::PromotionSlot->find_slot(class => PROMO_COMMERCIAL, type => PROMO_OBJECT_TYPE_ENTRY());
+        my $cpromoted_object = $cslot->current_promoted_object();
+        if ($cpromoted_object) {
+            my $centry = $cpromoted_object->object();
+            if ($centry && $promoted_object->is_the_same_object($centry)) {
+                $$reason_ref = 'in_commpromo'; 
+                return;
+            }
+        }
+    }
+
     return 1;
 }
 

Modified: trunk/htdocs/shop/selfpromo.bml.text.local
===================================================================
--- trunk/htdocs/shop/selfpromo.bml.text.local	2012-07-26 13:14:37 UTC (rev 12359)
+++ trunk/htdocs/shop/selfpromo.bml.text.local	2012-07-26 14:47:41 UTC (rev 12360)
@@ -43,6 +43,8 @@
 
 .error.entry_ineligible.entry_not_public=The entry at <a href="[[object_url]]">[[object_url]]</a> cannot be promoted because it is not publicly viewable.
 
+.error.entry_ineligible.in_commpromo=Sorry, but this entry <a href="[[object_url]]">[[object_url]]</a> is already promoted in commercial promo slot. Please, choose the other entry and re-create the order.
+
 .error.entry_ineligible.journal_adult_content=The entry at <a href="[[object_url]]">[[object_url]]</a> cannot be promoted because [[journal_ljuser]] is marked as containing adult content.
 
 .error.entry_ineligible.journal_banned=The entry at <a href="[[object_url]]">[[object_url]]</a> cannot be promoted because the journal it is in was banned from this service. If you believe this is in error, <a href="http://www.livejournal.com/support">contact our Support team</a>.

Tags: ljcom, local, pm, sunnyman, vtroitsky
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments